mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-16 23:39:44 +02:00
Normalize REGEX will remove more words and will leave digits for now.
This commit is contained in:
parent
5a8baa9d6c
commit
86e709e922
@ -25,7 +25,7 @@ public class ParserTest
|
||||
[Row("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", "The.Girls.Next.Door", 3, 6)]
|
||||
[Row("Degrassi.S10E27.WS.DSR.XviD-2HD", "Degrassi", 10, 27)]
|
||||
[Row("Parenthood.2010.S02E14.HDTV.XviD-LOL", "Parenthood", 2, 14)]
|
||||
[Row("Hawaii Five 0 S01E19 720p WEB DL DD5 1 H 264 NT", "Hawaii Five", 1, 19)]
|
||||
[Row("Hawaii Five 0 S01E19 720p WEB DL DD5 1 H 264 NT", "Hawaii Five0", 1, 19)]
|
||||
[Row("The Event S01E14 A Message Back 720p WEB DL DD5 1 H264 SURFER", "The Event", 1, 14)]
|
||||
[Row("Adam Hills In Gordon St Tonight S01E07 WS PDTV XviD FUtV", "Adam Hills In Gordon St Tonight", 1, 7)]
|
||||
[Row("Adam Hills In Gordon St Tonight S01E07 WS PDTV XviD FUtV", "Adam Hills In Gordon St Tonight", 1, 7)]
|
||||
@ -133,8 +133,11 @@ public void Normalize_Title(string dirty, string clean)
|
||||
|
||||
[Test]
|
||||
[Row("the")]
|
||||
[Row("And")]
|
||||
[Row("Or")]
|
||||
[Row("and")]
|
||||
[Row("or")]
|
||||
[Row("a")]
|
||||
[Row("an")]
|
||||
[Row("of")]
|
||||
public void Normalize_removed_common_words(string word)
|
||||
{
|
||||
var dirtyFormat = new[]
|
||||
|
@ -34,7 +34,7 @@ public static class Parser
|
||||
RegexOptions.Compiled),
|
||||
};
|
||||
|
||||
private static readonly Regex NormalizeRegex = new Regex(@"((\s|^)the(\s|$))|((\s|^)and(\s|$))|[^a-z]",
|
||||
private static readonly Regex NormalizeRegex = new Regex(@"((^|\W)(a|an|the|and|or|of)($|\W))|\W",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user