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:
niksedk 2011-01-18 06:36:30 +00:00
parent cb57e6aca1
commit a0914fa0b3
4 changed files with 8 additions and 8 deletions

View File

@ -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))
{

View File

@ -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)
{

View File

@ -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];

View File

@ -20,7 +20,7 @@ namespace Nikse.SubtitleEdit.Logic
}
public StripableText(string text)
: this(text, " >-\"”“['`´¶(♪¿¡.", " -\"”“]'`´¶)♪.!?:")
: this(text, " >-\"”“['`´¶(♪¿¡.…—", " -\"”“]'`´¶)♪.!?:…—")
{
}