From: Alex Bacart Date: Sat, 4 Feb 2023 06:48:35 +0000 (+0300) Subject: main : CSV format export trimmed spaces fix (#444) X-Git-Tag: upstream/1.7.4~1588 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3b1960520a390b7d0779401bf7f58e72fbef34e5;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp main : CSV format export trimmed spaces fix (#444) * Update main.cpp Removed string trimming * Update main.cpp * Update main.cpp * Revert "Update main.cpp" This reverts commit d8924fdcfe8a2980db0af47d42ec206fc1a3e9d0. * Revert "Update main.cpp" This reverts commit 252e508d8597231c61380ebea42b3707714345cc. --- diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 68f427c7..10d6b3c7 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -346,9 +346,6 @@ bool output_csv(struct whisper_context * ctx, const char * fname) { const int n_segments = whisper_full_n_segments(ctx); for (int i = 0; i < n_segments; ++i) { const char * text = whisper_full_get_segment_text(ctx, i); - if (text[0] == ' ') { - text = text + sizeof(char); //whisper_full_get_segment_text() returns a string with leading space, point to the next character. - } const int64_t t0 = whisper_full_get_segment_t0(ctx, i); const int64_t t1 = whisper_full_get_segment_t1(ctx, i);