Support text normalization via rule FST (#407)

This commit is contained in:
Fangjun Kuang
2023-11-05 08:59:03 +08:00
committed by GitHub
parent cca744e34e
commit d1a450bf82
12 changed files with 101 additions and 26 deletions

View File

@@ -21,10 +21,17 @@ namespace sherpa_onnx {
struct OfflineTtsConfig {
OfflineTtsModelConfig model;
// If not empty, it contains a list of rule FST filenames.
// Filenames are separated by a comma.
// Example value: rule1.fst,rule2,fst,rule3.fst
//
// If there are multiple rules, they are applied from left to right.
std::string rule_fsts;
OfflineTtsConfig() = default;
explicit OfflineTtsConfig(const OfflineTtsModelConfig &model)
: model(model) {}
OfflineTtsConfig(const OfflineTtsModelConfig &model,
const std::string &rule_fsts)
: model(model), rule_fsts(rule_fsts) {}
void Register(ParseOptions *po);
bool Validate() const;