Add jieba for Chinese TTS models (#797)

This commit is contained in:
Fangjun Kuang
2024-04-21 14:47:13 +08:00
committed by GitHub
parent 2e0ee0e8c8
commit 6b353bfb42
14 changed files with 513 additions and 8 deletions

View File

@@ -76,7 +76,7 @@ static std::vector<std::string> ProcessHeteronyms(
// Note: We don't use SymbolTable here since tokens may contain a blank
// in the first column
static std::unordered_map<std::string, int32_t> ReadTokens(std::istream &is) {
std::unordered_map<std::string, int32_t> ReadTokens(std::istream &is) {
std::unordered_map<std::string, int32_t> token2id;
std::string line;
@@ -113,7 +113,7 @@ static std::unordered_map<std::string, int32_t> ReadTokens(std::istream &is) {
return token2id;
}
static std::vector<int32_t> ConvertTokensToIds(
std::vector<int32_t> ConvertTokensToIds(
const std::unordered_map<std::string, int32_t> &token2id,
const std::vector<std::string> &tokens) {
std::vector<int32_t> ids;