Add C++ example for real-time ASR with nvidia/parakeet-tdt-0.6b-v2. (#2201)

This commit is contained in:
Fangjun Kuang
2025-05-11 16:30:38 +08:00
committed by GitHub
parent 028b8f2718
commit b269e5cccc
3 changed files with 297 additions and 1 deletions

View File

@@ -14,7 +14,8 @@ class SherpaDisplay {
void UpdateText(const std::string &text) { current_text_ = text; }
void FinalizeCurrentSentence() {
if (!current_text_.empty() && current_text_[0] != ' ') {
if (!current_text_.empty() &&
(current_text_[0] != ' ' || current_text_.size() > 1)) {
sentences_.push_back({GetCurrentDateTime(), std::move(current_text_)});
}
}