Skip to content

Commit

Permalink
Fix punctuations in tts (k2-fsa#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj authored Nov 10, 2023
1 parent d9e25ac commit c9f8c4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sherpa-onnx/csrc/lexicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ std::vector<int64_t> Lexicon::ConvertTextToTokenIdsChinese(

for (const auto &w : words) {
if (punctuations_.count(w)) {
if (sil != -1) {
if (token2id_.count(w)) {
ans.push_back(token2id_.at(w));
} else if (sil != -1) {
ans.push_back(sil);
}
continue;
Expand Down

0 comments on commit c9f8c4f

Please sign in to comment.