[NamesList] - Minor fix for IsInNamesMultiWordList().

This commit is contained in:
Ivandro Ismael 2017-04-11 03:45:39 +01:00
parent 91fa8d59c5
commit fd10a31b5b

View File

@ -252,13 +252,15 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries
text = text.Replace(Environment.NewLine, " ");
text = text.FixExtraSpaces();
foreach (string s in _namesMultiList)
if (_namesMultiList.Contains(word))
{
if (s.Contains(word) && text.Contains(s))
return true;
}
foreach (string multiWordName in _namesMultiList)
{
if (text.Contains(multiWordName))
{
if (s.StartsWith(word + " ", StringComparison.Ordinal) || s.EndsWith(" " + word, StringComparison.Ordinal) || s.Contains(" " + word + " "))
return true;
if (word == s)
if (multiWordName.StartsWith(word + " ", StringComparison.Ordinal) || multiWordName.EndsWith(" " + word, StringComparison.Ordinal) || multiWordName.Contains(" " + word + " "))
return true;
}
}