mirror of
https://github.com/Radarr/Radarr
synced 2024-12-24 17:01:38 +00:00
Normalize REGEX will remove more words and will leave digits for now.
This commit is contained in:
parent
5a8baa9d6c
commit
86e709e922
2 changed files with 7 additions and 4 deletions
|
@ -25,7 +25,7 @@ public class ParserTest
|
||||||
[Row("The.Girls.Next.Door.S03E06.DVDRip.XviD-WiDE", "The.Girls.Next.Door", 3, 6)]
|
[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("Degrassi.S10E27.WS.DSR.XviD-2HD", "Degrassi", 10, 27)]
|
||||||
[Row("Parenthood.2010.S02E14.HDTV.XviD-LOL", "Parenthood", 2, 14)]
|
[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("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)]
|
||||||
[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]
|
[Test]
|
||||||
[Row("the")]
|
[Row("the")]
|
||||||
[Row("And")]
|
[Row("and")]
|
||||||
[Row("Or")]
|
[Row("or")]
|
||||||
|
[Row("a")]
|
||||||
|
[Row("an")]
|
||||||
|
[Row("of")]
|
||||||
public void Normalize_removed_common_words(string word)
|
public void Normalize_removed_common_words(string word)
|
||||||
{
|
{
|
||||||
var dirtyFormat = new[]
|
var dirtyFormat = new[]
|
||||||
|
|
|
@ -34,7 +34,7 @@ public static class Parser
|
||||||
RegexOptions.Compiled),
|
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);
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in a new issue