mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
One more italic ocr fix - thx Zoltan :)
This commit is contained in:
parent
40262121b0
commit
4ccce2018e
@ -3,8 +3,8 @@
|
|||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageVersion Include="MSTest" Version="3.6.0" />
|
<PackageVersion Include="MSTest" Version="3.6.1" />
|
||||||
<PackageVersion Include="System.Drawing.Common" Version="8.0.8" />
|
<PackageVersion Include="System.Drawing.Common" Version="8.0.10" />
|
||||||
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageVersion Include="UTF.Unknown" Version="2.5.1" />
|
<PackageVersion Include="UTF.Unknown" Version="2.5.1" />
|
||||||
<PackageVersion Include="zlib.net-mutliplatform" Version="1.0.8" />
|
<PackageVersion Include="zlib.net-mutliplatform" Version="1.0.8" />
|
||||||
|
@ -284,6 +284,29 @@ namespace Test.Logic.Ocr
|
|||||||
Assert.AreEqual("Joe:\r\n<i>Godbye!</i>", result);
|
Assert.AreEqual("Joe:\r\n<i>Godbye!</i>", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TestWordInItalicSecondLineAndBrackets()
|
||||||
|
{
|
||||||
|
var matches = new List<VobSubOcr.CompareMatch>
|
||||||
|
{
|
||||||
|
new VobSubOcr.CompareMatch("[J", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("o", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("e", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("]:", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("\r", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("\n", false, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("G", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("o", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("d", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("b", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("y", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("e", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
new VobSubOcr.CompareMatch("!", true, 0, Guid.NewGuid().ToString()),
|
||||||
|
};
|
||||||
|
|
||||||
|
string result = MatchesToItalicStringConverter.GetStringWithItalicTags(matches);
|
||||||
|
Assert.AreEqual("[Joe]:\r\n<i>Godbye!</i>", result);
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestPartInItalic()
|
public void TestPartInItalic()
|
||||||
{
|
{
|
||||||
|
@ -220,7 +220,11 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
|||||||
if (line.Count > 0)
|
if (line.Count > 0)
|
||||||
{
|
{
|
||||||
line.Add(t);
|
line.Add(t);
|
||||||
if (index < matches.Count - 1 && matches[index + 1].Text == Environment.NewLine)
|
if (index < matches.Count - 1 && ":)]".Contains(matches[index + 1].ToString()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (index < matches.Count - 1 && matches[index + 1].Text == Environment.NewLine)
|
||||||
{
|
{
|
||||||
result.Add(new SplitItem { Matches = line, Separator = Environment.NewLine });
|
result.Add(new SplitItem { Matches = line, Separator = Environment.NewLine });
|
||||||
skipNext = true;
|
skipNext = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user