From a3e42a40260be7e0769286fc0ed7f7fd839f0fd5 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Fri, 24 Apr 2020 12:05:53 +0200 Subject: [PATCH] Minor fixes for OCR Handle "1" as "I" i some situations + don't count "I" and "a" as wrong letters in English --- Dictionaries/eng_OCRFixReplaceList.xml | 4 ++++ src/Logic/Ocr/OcrFixEngine.cs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Dictionaries/eng_OCRFixReplaceList.xml b/Dictionaries/eng_OCRFixReplaceList.xml index 64a239440..ad0939f97 100644 --- a/Dictionaries/eng_OCRFixReplaceList.xml +++ b/Dictionaries/eng_OCRFixReplaceList.xml @@ -173,6 +173,7 @@ + @@ -2201,6 +2202,7 @@ + @@ -2380,6 +2382,7 @@ + @@ -3201,5 +3204,6 @@ + \ No newline at end of file diff --git a/src/Logic/Ocr/OcrFixEngine.cs b/src/Logic/Ocr/OcrFixEngine.cs index 4e92616d9..e604e1e0c 100644 --- a/src/Logic/Ocr/OcrFixEngine.cs +++ b/src/Logic/Ocr/OcrFixEngine.cs @@ -2015,6 +2015,11 @@ namespace Nikse.SubtitleEdit.Logic.Ocr correct = word.Length > 2 && _hunspell.Spell(word.Trim('\'')); } + if (!correct && word.Length == 1 && _threeLetterIsoLanguageName == "eng" && (word == "I" || word == "A" || word == "a")) + { + correct = true; + } + if (correct) { numberOfCorrectWords++;