diff --git a/src/Changelog.txt b/src/Changelog.txt index a14414d47..be62fd623 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -14,6 +14,7 @@ * Many settings now remembered from "Export to image based foramt" * Dropping a video file on empty waveform will now start extraction of waveform - thx Leon * Better reading of SCC files + * Better handling of apostrophe in spell check - thx Betsy25 * FIXED: * Waveform/spectrogram: Moving start/end with ALT down now always works - thx Leon * Waveform/spectrogram: Move border left/right now also always works even diff --git a/src/Forms/SpellCheck.cs b/src/Forms/SpellCheck.cs index 1c3d4521b..16f73a470 100644 --- a/src/Forms/SpellCheck.cs +++ b/src/Forms/SpellCheck.cs @@ -1,14 +1,13 @@ -using System; +using Nikse.SubtitleEdit.Logic; +using Nikse.SubtitleEdit.Logic.Enums; +using Nikse.SubtitleEdit.Logic.SpellCheck; +using System; using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Text.RegularExpressions; +using System.Text; using System.Windows.Forms; using System.Xml; -using Nikse.SubtitleEdit.Logic; -using Nikse.SubtitleEdit.Logic.Enums; -using Nikse.SubtitleEdit.Logic.SpellCheck; -using System.Text; namespace Nikse.SubtitleEdit.Forms { @@ -650,11 +649,20 @@ namespace Nikse.SubtitleEdit.Forms { _noOfCorrectWords++; } + else if ((_currentWord.EndsWith("'") || _currentWord.StartsWith("'")) && _userWordList.IndexOf(_currentWord.Trim("'".ToCharArray()).ToLower()) >= 0) + { + _noOfCorrectWords++; + } else if (_changeAllDictionary.ContainsKey(_currentWord)) { _noOfChangedWords++; _mainWindow.CorrectWord(_changeAllDictionary[_currentWord], _currentParagraph, _currentWord, ref _firstChange); } + else if (_changeAllDictionary.ContainsKey(_currentWord.Trim("'".ToCharArray()))) + { + _noOfChangedWords++; + _mainWindow.CorrectWord(_changeAllDictionary[_currentWord], _currentParagraph, _currentWord.Trim("'".ToCharArray()), ref _firstChange); + } else if (_namesEtcListUppercase.IndexOf(_currentWord) >= 0) { _noOfNamesEtc++; @@ -797,7 +805,6 @@ namespace Nikse.SubtitleEdit.Forms List replaceNames = new List(); s = Utilities.RemoveHtmlTags(s); s = GetTextWithoutUserWordsAndNames(replaceIds, replaceNames, s); - //_words = s.Split(.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); _words = Split(s); _words = FixWordsInserUserWordAndNames(replaceIds, replaceNames, _words); return s;