mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 13:12:39 +01:00
parent
bfbff43703
commit
9c582b4d74
@ -179,6 +179,30 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ReplaceAssTagsWithBlanks(string s)
|
||||||
|
{
|
||||||
|
int start = s.IndexOf("{\\", StringComparison.Ordinal);
|
||||||
|
int end = s.IndexOf('}');
|
||||||
|
if (start < 0 || end < 0 || end < start)
|
||||||
|
{
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (start >= 0)
|
||||||
|
{
|
||||||
|
end = s.IndexOf('}', start + 1);
|
||||||
|
if (end < start)
|
||||||
|
break;
|
||||||
|
int l = end - start + 1;
|
||||||
|
s = s.Remove(start, l).Insert(start, string.Empty.PadLeft(l));
|
||||||
|
end++;
|
||||||
|
if (end >= s.Length)
|
||||||
|
break;
|
||||||
|
start = s.IndexOf("{\\", end, StringComparison.Ordinal);
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsWordInUserPhrases(int index, List<SpellCheckWord> words)
|
public bool IsWordInUserPhrases(int index, List<SpellCheckWord> words)
|
||||||
{
|
{
|
||||||
string current = words[index].Text;
|
string current = words[index].Text;
|
||||||
|
@ -785,6 +785,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
private void SetWords(string s)
|
private void SetWords(string s)
|
||||||
{
|
{
|
||||||
s = _spellCheckWordLists.ReplaceHtmlTagsWithBlanks(s);
|
s = _spellCheckWordLists.ReplaceHtmlTagsWithBlanks(s);
|
||||||
|
s = _spellCheckWordLists.ReplaceAssTagsWithBlanks(s);
|
||||||
s = _spellCheckWordLists.ReplaceKnownWordsOrNamesWithBlanks(s);
|
s = _spellCheckWordLists.ReplaceKnownWordsOrNamesWithBlanks(s);
|
||||||
_words = SpellCheckWordLists.Split(s);
|
_words = SpellCheckWordLists.Split(s);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user