mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
[OcrFixEngine] - fix logic
This commit is contained in:
parent
8508cc72f4
commit
8997d240b8
@ -681,18 +681,22 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
|
||||
private static bool EndsWithAbbreviation(string line, HashSet<string> abbreviationList)
|
||||
{
|
||||
if (string.IsNullOrEmpty(line) || abbreviationList == null)
|
||||
return false;
|
||||
|
||||
foreach (string abbreviation in abbreviationList)
|
||||
if (string.IsNullOrEmpty(line))
|
||||
{
|
||||
if (line.EndsWith(" " + abbreviation, StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (line.Length > 5 && line[line.Length - 3] == '.' && char.IsLetter(line[line.Length - 2]))
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
if (abbreviationList != null)
|
||||
{
|
||||
foreach (string abbreviation in abbreviationList)
|
||||
{
|
||||
if (line.EndsWith(" " + abbreviation, StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1237,8 +1241,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
}
|
||||
}
|
||||
if (_nameListObj != null)
|
||||
{
|
||||
_nameListObj.Add(s);
|
||||
{
|
||||
_nameListObj.Add(s);
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
Loading…
Reference in New Issue
Block a user