mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Improved "Fix common errors" a bit
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1019 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
71b267c786
commit
392fb7c680
@ -4,8 +4,9 @@ Subtitle Edit Changelog
|
|||||||
* NEW:
|
* NEW:
|
||||||
* Arabic language file - thx Zakaria Farah Abu Wael
|
* Arabic language file - thx Zakaria Farah Abu Wael
|
||||||
* Export to VobSub format
|
* Export to VobSub format
|
||||||
* Added new subtitle formats (now more than 80!)
|
* Added new subtitle formats (now ~90!)
|
||||||
* Added export to FAB image script
|
* Added export to FAB image script
|
||||||
|
* Added import of XSub from DivX files (use File -> Open)
|
||||||
* IMPROVED:
|
* IMPROVED:
|
||||||
* Updated Basque languaged file - thx Xabier Aramendi
|
* Updated Basque languaged file - thx Xabier Aramendi
|
||||||
* Export images alignment - thx Marcin
|
* Export images alignment - thx Marcin
|
||||||
|
@ -1215,7 +1215,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
arr[0] = arr[0].Insert(1, " ");
|
arr[0] = arr[0].Insert(1, " ");
|
||||||
if (arr[0].Length > 6 && arr[0].StartsWith("<i>-") && arr[0][4] != ' ')
|
if (arr[0].Length > 6 && arr[0].StartsWith("<i>-") && arr[0][4] != ' ')
|
||||||
arr[0] = arr[0].Insert(4, " ");
|
arr[0] = arr[0].Insert(4, " ");
|
||||||
if (arr[1][0] == '-' && arr[1][1] != ' ')
|
if (arr[1][0] == '-' && arr[1][1] != ' ' && arr[1][1] != '-')
|
||||||
arr[1] = arr[1].Insert(1, " ");
|
arr[1] = arr[1].Insert(1, " ");
|
||||||
if (arr[1].Length > 6 && arr[1].StartsWith("<i>-") && arr[1][4] != ' ')
|
if (arr[1].Length > 6 && arr[1].StartsWith("<i>-") && arr[1][4] != ' ')
|
||||||
arr[1] = arr[1].Insert(4, " ");
|
arr[1] = arr[1].Insert(4, " ");
|
||||||
@ -1484,7 +1484,12 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
int index = text.IndexOf("\"");
|
int index = text.IndexOf("\"");
|
||||||
if (text[index - 1] == ' ')
|
if (text[index - 1] == ' ')
|
||||||
p.Text = p.Text.Trim() + "\"";
|
{
|
||||||
|
if (p.Text.EndsWith(","))
|
||||||
|
p.Text = p.Text.Insert(p.Text.Length - 1, "\"").Trim();
|
||||||
|
else
|
||||||
|
p.Text = p.Text.Trim() + "\"";
|
||||||
|
}
|
||||||
else if (text[index + 1] == ' ')
|
else if (text[index + 1] == ' ')
|
||||||
p.Text = "\"" + p.Text;
|
p.Text = "\"" + p.Text;
|
||||||
}
|
}
|
||||||
@ -2297,6 +2302,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
if (prev == "-" && match.Index > 2)
|
if (prev == "-" && match.Index > 2)
|
||||||
fix = false;
|
fix = false;
|
||||||
|
|
||||||
|
if (fix && next == "-" && match.Index < s.Length - 5 && s[match.Index + 2] == 'l' && !(Environment.NewLine + " <>!.?:;,").Contains(s[match.Index + 3].ToString()))
|
||||||
|
fix = false;
|
||||||
|
|
||||||
if (fix)
|
if (fix)
|
||||||
{
|
{
|
||||||
string temp = s.Substring(0, match.Index) + "I";
|
string temp = s.Substring(0, match.Index) + "I";
|
||||||
@ -2384,7 +2392,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
idx = text.IndexOf("-", idxNL);
|
idx = text.IndexOf("-", idxNL);
|
||||||
if (idx >=0 && idxNL + 5 > idxNL)
|
if (idx >=0 && idxNL + 5 > idxNL)
|
||||||
{
|
{
|
||||||
text = text.Remove(idx, 1).TrimStart();
|
text = text.Remove(idx, 1).TrimStart().Replace(Environment.NewLine + " ", Environment.NewLine);
|
||||||
|
|
||||||
idx = text.IndexOf("-", idxNL);
|
idx = text.IndexOf("-", idxNL);
|
||||||
if (idx >= 0 && idxNL + 5 > idxNL)
|
if (idx >= 0 && idxNL + 5 > idxNL)
|
||||||
@ -2392,7 +2400,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
text = text.Remove(idx, 1).TrimStart();
|
text = text.Remove(idx, 1).TrimStart();
|
||||||
|
|
||||||
text = text.Replace(" ", " ");
|
text = text.Replace(" ", " ");
|
||||||
text = text.Remove(idx, 1).Replace(Environment.NewLine + " ", Environment.NewLine);
|
text = text.Replace(Environment.NewLine + " ", Environment.NewLine);
|
||||||
text = text.Replace("> ", ">");
|
text = text.Replace("> ", ">");
|
||||||
text = text.Replace(" <", "<");
|
text = text.Replace(" <", "<");
|
||||||
}
|
}
|
||||||
|
@ -900,6 +900,10 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
|||||||
if (line.EndsWith(" " + abbreviation.ToLower()))
|
if (line.EndsWith(" " + abbreviation.ToLower()))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line.Length > 5 && line[line.Length - 3] == '.' && Utilities.GetLetters(true, true, false).Contains(line[line.Length - 2].ToString()))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,7 +1220,7 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] words = tempLine.Split((Environment.NewLine + " ¡¿,.!?:;()[]{}+-£\"”“#&%…—♪").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
string[] words = tempLine.Split((Environment.NewLine + " ¡¿,.!?:;()[]{}+-£\"”“#&%…—♪/").ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||||
for (int i = 0; i < words.Length; i++)
|
for (int i = 0; i < words.Length; i++)
|
||||||
{
|
{
|
||||||
string word = words[i].TrimStart('\'');
|
string word = words[i].TrimStart('\'');
|
||||||
|
Loading…
Reference in New Issue
Block a user