Turn of some post-processing for "--highlight_words true"

Related to https://github.com/Purfview/whisper-standalone-win/issues/223
This commit is contained in:
Nikolaj Olsson 2024-03-22 22:57:45 +01:00
parent 853e6333b4
commit 127530fbb0

View File

@ -121,7 +121,7 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
subtitle = FixShortDuration(subtitle);
}
if (splitLines && !IsNonStandardLineTerminationLanguage(TwoLetterLanguageCode))
if (splitLines && !IsNonStandardLineTerminationLanguage(TwoLetterLanguageCode) && !Configuration.Settings.Tools.WhisperExtraSettings.Contains("--highlight_words true", StringComparison.OrdinalIgnoreCase))
{
var totalMaxChars = Configuration.Settings.General.SubtitleLineMaximumLength * Configuration.Settings.General.MaxNumberOfLines;
subtitle = SplitLongLinesHelper.SplitLongLinesInSubtitle(subtitle, totalMaxChars, Configuration.Settings.General.SubtitleLineMaximumLength);
@ -129,7 +129,7 @@ namespace Nikse.SubtitleEdit.Core.AudioToText
subtitle = TryForWholeSentences(subtitle, TwoLetterLanguageCode, Configuration.Settings.General.SubtitleLineMaximumLength);
}
if (mergeLines)
if (mergeLines && !Configuration.Settings.Tools.WhisperExtraSettings.Contains("--highlight_words true", StringComparison.OrdinalIgnoreCase))
{
subtitle = MergeShortLines(subtitle, TwoLetterLanguageCode);
subtitle = AutoBalanceLines(subtitle, TwoLetterLanguageCode);