mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Ignore (some) urls in spell check
This commit is contained in:
parent
471436073d
commit
0c0441b336
@ -655,6 +655,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_currentWord = _currentWord.TrimEnd('\'');
|
||||
correct = true;
|
||||
}
|
||||
|
||||
if (!correct)
|
||||
{
|
||||
string removeUnicode = _currentWord.Replace("\u200b", string.Empty); // zero width space
|
||||
@ -663,6 +664,18 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
correct = DoSpell(removeUnicode);
|
||||
}
|
||||
|
||||
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() == "net") &&
|
||||
_currentParagraph.Text.IndexOf(_words[_wordsIndex - 1].Text + "." +
|
||||
_currentWord + "." +
|
||||
_words[_wordsIndex + 1].Text, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
correct = true; // do not spell check urls
|
||||
}
|
||||
|
||||
if (!correct && (_languageName.StartsWith("ar_", StringComparison.Ordinal) || _languageName == "ar"))
|
||||
{
|
||||
var trimmed = _currentWord.Trim('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ',', '،');
|
||||
|
Loading…
Reference in New Issue
Block a user