Skip to content

Commit

Permalink
Fix punctuations in tts (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Nov 10, 2023
1 parent 61341b7 commit 47947ff
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 47947ff

Please sign in to comment.