Spell check: Allow user words starting with dash - thx t2YU2m8l83 :)

Fix #4310
This commit is contained in:
Nikolaj Olsson 2020-08-24 13:32:33 +02:00
parent 2b1cf1e717
commit 712ca5427d
3 changed files with 13 additions and 2 deletions

View File

@ -34,6 +34,7 @@
* Change preferred ANSI code page for Turkish(1254)/Hebrew(1255)
* Keep italic/bold/u from RTF in "Import plain text" - thx George
* "Modify selection/uppercase" now ignores tags - thx Lokotito
* Spell check: Allow user words starting with dash - thx t2YU2m8l83
* FIXED:
* Fix for overlap in "Tools -> Adjust durations" - thx Christian
* Fix bug in EBU STL ms to frames - thx Lucius Snow

View File

@ -666,8 +666,8 @@ namespace Nikse.SubtitleEdit.Forms
if (!correct && _wordsIndex > 1 && _words.Count > _wordsIndex &&
_words[_wordsIndex - 1].Text.ToLowerInvariant() == "www" &&
(_words[_wordsIndex + 1].Text.ToLowerInvariant() == "com" ||
_words[_wordsIndex + 1].Text.ToLowerInvariant() == "org" ||
(_words[_wordsIndex + 1].Text.ToLowerInvariant() == "com" ||
_words[_wordsIndex + 1].Text.ToLowerInvariant() == "org" ||
_words[_wordsIndex + 1].Text.ToLowerInvariant() == "net") &&
_currentParagraph.Text.IndexOf(_words[_wordsIndex - 1].Text + "." +
_currentWord + "." +
@ -712,6 +712,11 @@ namespace Nikse.SubtitleEdit.Forms
{
correct = _spellCheckWordLists.HasUserWord(wordWithDash.Replace("", "-"));
}
if (!correct && _spellCheckWordLists.HasUserWord("-" + _currentWord))
{
correct = true;
}
}
if (!correct && _wordsIndex < _words.Count - 1 && (_currentParagraph.Text[_words[_wordsIndex + 1].Index - 1] == '-' || _currentParagraph.Text[_words[_wordsIndex + 1].Index - 1] == ''))
{

View File

@ -1504,6 +1504,11 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
}
}
}
if (!correct && _spellCheckWordLists.HasUserWord("-" + word))
{
correct = true;
}
}
if (!correct && word.Contains('/') && !word.Contains("//", StringComparison.Ordinal))