mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Testing some German nouns for fix casing after audio-to-text
This commit is contained in:
parent
69cfe59371
commit
2d225420aa
3616
Dictionaries/deu_Nouns.txt
Normal file
3616
Dictionaries/deu_Nouns.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -236,6 +236,7 @@ Source: ..\Dictionaries\fra_WordSplitList.txt; DestDir: {userappdata}\Subtit
|
||||
Source: ..\Dictionaries\ita_WordSplitList.txt; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main
|
||||
Source: ..\Dictionaries\pol_WordSplitList.txt; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main
|
||||
Source: ..\Dictionaries\spa_WordSplitList.txt; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main
|
||||
Source: ..\Dictionaries\deu_Nouns.txt; DestDir: {userappdata}\Subtitle Edit\Dictionaries; Flags: ignoreversion onlyifdoesntexist; Components: main
|
||||
|
||||
|
||||
Source: ..\Ocr\Latin.db; DestDir: {userappdata}\Subtitle Edit\Ocr; Flags: ignoreversion uninsneveruninstall onlyifdoesntexist; Components: main
|
||||
@ -372,6 +373,7 @@ Type: files; Name: {app}\Dictionaries\fra_WordSplitList.txt; Check: Is
|
||||
Type: files; Name: {app}\Dictionaries\ita_WordSplitList.txt; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Dictionaries\pol_WordSplitList.txt; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Dictionaries\spa_WordSplitList.txt; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Dictionaries\deu_Nouns.txt; Check: IsUpgrade()
|
||||
|
||||
Type: dirifempty; Name: {app}\Dictionaries; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\TessData\eng.DangAmbigs; Check: IsUpgrade()
|
||||
|
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.Common;
|
||||
using Nikse.SubtitleEdit.Core.Dictionaries;
|
||||
using Nikse.SubtitleEdit.Core.Forms.FixCommonErrors;
|
||||
@ -275,6 +277,27 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
|
||||
}
|
||||
}
|
||||
|
||||
// fix german nouns
|
||||
if (language == "de")
|
||||
{
|
||||
var inputFile = Path.Combine(Configuration.DictionariesDirectory, "deu_Nouns.txt");
|
||||
if (File.Exists(inputFile))
|
||||
{
|
||||
var nounList = FileUtil.ReadAllLinesShared(inputFile, Encoding.UTF8);
|
||||
foreach (var paragraph in subtitle.Paragraphs)
|
||||
{
|
||||
var text = paragraph.Text;
|
||||
var textNoTags = HtmlUtil.RemoveHtmlTags(text, true);
|
||||
if (textNoTags != textNoTags.ToUpperInvariant() && !string.IsNullOrEmpty(text))
|
||||
{
|
||||
var st = new StrippableText(text);
|
||||
st.FixCasing(nounList, true, false, false, string.Empty);
|
||||
paragraph.Text = st.MergedString;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user