mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Issue 7: Spell check should ignore ellipsis character as punctuation
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@262 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
cb57e6aca1
commit
a0914fa0b3
@ -340,14 +340,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
string oldText = text;
|
||||
text = RemoveColon(text);
|
||||
StripableText st = new StripableText(text, " >-\"'‘`´♪¿¡.", " -\"'`´♪.!?:");
|
||||
StripableText st = new StripableText(text, " >-\"'‘`´♪¿¡.…—", " -\"'`´♪.!?:…—");
|
||||
var sb = new StringBuilder();
|
||||
string[] parts = st.StrippedText.Trim().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
int lineNumber = 0;
|
||||
bool removedDialogInFirstLine = false;
|
||||
foreach (string s in parts)
|
||||
{
|
||||
StripableText stSub = new StripableText(s, " >-\"'‘`´♪¿¡.", " -\"'`´♪.!?:");
|
||||
{
|
||||
StripableText stSub = new StripableText(s, " >-\"'‘`´♪¿¡.…—", " -\"'`´♪.!?:…—");
|
||||
if (!StartAndEndsWithHearImpariedTags(stSub.StrippedText))
|
||||
{
|
||||
if (removedDialogInFirstLine && stSub.Pre.Contains("- "))
|
||||
@ -378,7 +378,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
text = st.Pre + sb.ToString().Trim() + st.Post;
|
||||
text = RemoveColon(text);
|
||||
|
||||
st = new StripableText(text, " >-\"'‘`´♪¿¡.", " -\"'`´♪.!?:");
|
||||
st = new StripableText(text, " >-\"'‘`´♪¿¡.…—", " -\"'`´♪.!?:…—");
|
||||
text = st.StrippedText;
|
||||
if (StartAndEndsWithHearImpariedTags(text))
|
||||
{
|
||||
|
@ -420,7 +420,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_currentIndex++;
|
||||
_currentParagraph = _subtitle.Paragraphs[_currentIndex];
|
||||
string s = Utilities.RemoveHtmlTags(_currentParagraph.Text);
|
||||
_words = s.Split(" .,-?!:;\"“”()[]{}|<>/+\r\n¿¡".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
_words = s.Split(" .,-?!:;\"“”()[]{}|<>/+\r\n¿¡…—".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
_wordsIndex = 0;
|
||||
if (_words.Length == 0)
|
||||
{
|
||||
|
@ -667,7 +667,7 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
||||
if (_hunspell == null)
|
||||
return line;
|
||||
|
||||
string[] words = line.Split((Environment.NewLine + " ,.!?:;()[]{}+-$£\"”“#&%").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] words = line.Split((Environment.NewLine + " ,.!?:;()[]{}+-$£\"”“#&%…—").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
for (int i = 0; i < words.Length; i++)
|
||||
{
|
||||
string word = words[i];
|
||||
@ -1007,7 +1007,7 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
||||
return 0;
|
||||
|
||||
int wordsNotFound = 0;
|
||||
string[] words = line.Split((Environment.NewLine + " ,.!?:;()[]{}+-$£\"#&%").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] words = line.Split((Environment.NewLine + " ,.!?:;()[]{}+-$£\"#&%…“”").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
for (int i = 0; i < words.Length; i++)
|
||||
{
|
||||
string word = words[i];
|
||||
|
@ -20,7 +20,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
|
||||
public StripableText(string text)
|
||||
: this(text, " >-\"”“['‘`´¶(♪¿¡.", " -\"”“]'`´¶)♪.!?:")
|
||||
: this(text, " >-\"”“['‘`´¶(♪¿¡.…—", " -\"”“]'`´¶)♪.!?:…—")
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user