Add C and CXX API for homophone replacer (#2156)
This commit is contained in:
@@ -99,6 +99,10 @@ OnlineRecognizer OnlineRecognizer::Create(
|
||||
c.hotwords_buf = config.hotwords_buf.c_str();
|
||||
c.hotwords_buf_size = config.hotwords_buf.size();
|
||||
|
||||
c.hr.dict_dir = config.hr.dict_dir.c_str();
|
||||
c.hr.lexicon = config.hr.lexicon.c_str();
|
||||
c.hr.rule_fsts = config.hr.rule_fsts.c_str();
|
||||
|
||||
auto p = SherpaOnnxCreateOnlineRecognizer(&c);
|
||||
return OnlineRecognizer(p);
|
||||
}
|
||||
@@ -261,6 +265,10 @@ OfflineRecognizer OfflineRecognizer::Create(
|
||||
|
||||
c.blank_penalty = config.blank_penalty;
|
||||
|
||||
c.hr.dict_dir = config.hr.dict_dir.c_str();
|
||||
c.hr.lexicon = config.hr.lexicon.c_str();
|
||||
c.hr.rule_fsts = config.hr.rule_fsts.c_str();
|
||||
|
||||
auto p = SherpaOnnxCreateOfflineRecognizer(&c);
|
||||
return OfflineRecognizer(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user