mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Merge pull request #3467 from ivandrofly/ocrfixengine
OcrFixEngine: minor optimization
This commit is contained in:
commit
11a926f717
@ -1350,21 +1350,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
|
||||
if (!correct && word.Contains('/') && !word.Contains("//"))
|
||||
{
|
||||
var slashedWords = word.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
bool allSlashedCorrect = true;
|
||||
foreach (var slashedWord in slashedWords)
|
||||
{
|
||||
if (slashedWord.Length < 2)
|
||||
{
|
||||
allSlashedCorrect = false;
|
||||
}
|
||||
|
||||
if (allSlashedCorrect && !(DoSpell(slashedWord) || IsWordKnownOrNumber(slashedWord, line)))
|
||||
{
|
||||
allSlashedCorrect = false;
|
||||
}
|
||||
}
|
||||
correct = allSlashedCorrect;
|
||||
correct = word.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.All(w => w.Length > 2 && (DoSpell(w) || IsWordKnownOrNumber(word, line)));
|
||||
}
|
||||
|
||||
if (word.Length == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user