mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Improve fix ocr for large lines
This commit is contained in:
parent
d83925031d
commit
655c16a100
@ -1113,7 +1113,7 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries
|
||||
int appendFrom = 0;
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
if (text.Substring(i).StartsWith(word, StringComparison.Ordinal) && i >= appendFrom)
|
||||
if (text[i] == word[0] && i >= appendFrom && text.Substring(i).StartsWith(word, StringComparison.Ordinal))
|
||||
{
|
||||
bool startOk = i == 0;
|
||||
if (!startOk)
|
||||
|
@ -1403,7 +1403,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
words.Add(w.Trim(trimChars));
|
||||
}
|
||||
|
||||
for (int i = 0; i < words.Count; i++)
|
||||
for (int i = 0; i < words.Count && i < 1000; i++)
|
||||
{
|
||||
string word = words[i].TrimStart('\'');
|
||||
string wordNotEndTrimmed = word;
|
||||
|
Loading…
Reference in New Issue
Block a user