mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Merge pull request #1944 from ivandrofly/ocrfrl
[OcrReplaceList] - Remove fruitless replaces.
This commit is contained in:
commit
e07a0340da
@ -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…
Reference in New Issue
Block a user