Fangjun Kuang
Committed by GitHub

Fix punctuations in tts (#417)

@@ -214,7 +214,9 @@ std::vector<int64_t> Lexicon::ConvertTextToTokenIdsChinese( @@ -214,7 +214,9 @@ std::vector<int64_t> Lexicon::ConvertTextToTokenIdsChinese(
214 214
215 for (const auto &w : words) { 215 for (const auto &w : words) {
216 if (punctuations_.count(w)) { 216 if (punctuations_.count(w)) {
217 - if (sil != -1) { 217 + if (token2id_.count(w)) {
  218 + ans.push_back(token2id_.at(w));
  219 + } else if (sil != -1) {
218 ans.push_back(sil); 220 ans.push_back(sil);
219 } 221 }
220 continue; 222 continue;