mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2025-01-31 13:01:39 +01:00
[OcrReplaceList] - Remove fruitless replaces.
This commit is contained in:
parent
ce0f2fdd37
commit
e2ea2c87e2
@ -182,16 +182,14 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries
|
||||
{
|
||||
if (s.Contains(from))
|
||||
{
|
||||
string with = _beginLineReplaceList[from];
|
||||
if (s.StartsWith(from, StringComparison.Ordinal))
|
||||
s = s.Remove(0, from.Length).Insert(0, _beginLineReplaceList[from]);
|
||||
s = s.Replace(". " + from, ". " + _beginLineReplaceList[from]);
|
||||
s = s.Replace("! " + from, "! " + _beginLineReplaceList[from]);
|
||||
s = s.Replace("? " + from, "? " + _beginLineReplaceList[from]);
|
||||
s = s.Replace(". " + Environment.NewLine + from, ". " + Environment.NewLine + _beginLineReplaceList[from]);
|
||||
s = s.Replace("! " + Environment.NewLine + from, "! " + Environment.NewLine + _beginLineReplaceList[from]);
|
||||
s = s.Replace("? " + Environment.NewLine + from, "? " + Environment.NewLine + _beginLineReplaceList[from]);
|
||||
s = s.Remove(0, from.Length).Insert(0, with);
|
||||
s = s.Replace(". " + from, ". " + with);
|
||||
s = s.Replace("! " + from, "! " + with);
|
||||
s = s.Replace("? " + from, "? " + with);
|
||||
if (s.StartsWith("\"" + from, StringComparison.Ordinal) && !from.StartsWith('"'))
|
||||
s = s.Replace("\"" + from, "\"" + _beginLineReplaceList[from]);
|
||||
s = s.Replace("\"" + from, "\"" + with);
|
||||
}
|
||||
}
|
||||
sb.AppendLine(s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user