Skip to content

Commit

Permalink
enable only French
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Feb 12, 2025
1 parent ac29e70 commit 24736c3
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions sherpa-onnx/csrc/kokoro-multi-lang-lexicon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class KokoroMultiLangLexicon::Impl {

std::string expr_chinese = "([\\u4e00-\\u9fff]+)";

std::string expr = expr_chinese + "|" + expr_english + "|" + expr_german +
"|" + expr_french;
// std::string expr = expr_english + "|" + expr_german + "|" + expr_french;
std::string expr = expr_french;

// std::string expr =
// "([;:,.?!'\"…\\(\\)“”])|([\\u4e00-\\u9fff]+)|([äöüßÄÖÜ\\u0000-\\u007f]+"
Expand All @@ -137,17 +137,8 @@ class KokoroMultiLangLexicon::Impl {

std::vector<std::vector<int32_t>> ids_vec;

if (c < 0x80) {
if (debug_) {
SHERPA_ONNX_LOGE("Non-Chinese: %s", ms.c_str());
}
ids_vec = ConvertEnglishToTokenIDs(ms, meta_data_.voice);
} else {
if (debug_) {
SHERPA_ONNX_LOGE("Chinese: %s", ms.c_str());
}
ids_vec = ConvertChineseToTokenIDs(ms);
}
SHERPA_ONNX_LOGE("Non-Chinese: %s", ms.c_str());
ids_vec = ConvertEnglishToTokenIDs(ms, meta_data_.voice);

for (const auto &ids : ids_vec) {
if (ids.size() > 4) {
Expand Down

0 comments on commit 24736c3

Please sign in to comment.