From cc444e30943ba8a66bff2937abd70e1e83600f40 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Tue, 23 Oct 2018 09:37:47 +0200 Subject: [PATCH] Try using wordlists for uppercase i inside words - thx TeDDy :) E.g. "RIverdale" to "Riverdale" --- src/Logic/OCR/OcrFixEngine.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Logic/OCR/OcrFixEngine.cs b/src/Logic/OCR/OcrFixEngine.cs index cac44a8f1..e2bb4489b 100644 --- a/src/Logic/OCR/OcrFixEngine.cs +++ b/src/Logic/OCR/OcrFixEngine.cs @@ -411,9 +411,24 @@ namespace Nikse.SubtitleEdit.Logic.Ocr { bool doFixWord = !(word.Length == 1 && sb.Length > 1 && sb.EndsWith('-')); if (doFixWord) + { fixedWord = _ocrFixReplaceList.FixCommonWordErrors(word.ToString()); + + // Try using wordlists for uppercase i inside words, e.g. "NIkolaj" to "Nikolaj" + if (fixedWord.Contains('I')) + { + var temp = fixedWord.Replace('I', 'i'); + if (temp != fixedWord.ToUpperInvariant()) + { + if (_nameList.Contains(temp)) + fixedWord = temp; + } + } + } else + { fixedWord = word.ToString(); + } } sb.Append(fixedWord); lastWord = fixedWord;