From 127530fbb0310ac975762beb83901e96900f1549 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Fri, 22 Mar 2024 22:57:45 +0100 Subject: [PATCH] Turn of some post-processing for "--highlight_words true" Related to https://github.com/Purfview/whisper-standalone-win/issues/223 --- src/libse/AudioToText/AudioToTextPostProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libse/AudioToText/AudioToTextPostProcessor.cs b/src/libse/AudioToText/AudioToTextPostProcessor.cs index a1fb9ddd4..e27043309 100644 --- a/src/libse/AudioToText/AudioToTextPostProcessor.cs +++ b/src/libse/AudioToText/AudioToTextPostProcessor.cs @@ -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);