Add C and CXX API for homophone replacer (#2156)
This commit is contained in:
@@ -112,6 +112,12 @@ SHERPA_ONNX_API typedef struct SherpaOnnxOnlineCtcFstDecoderConfig {
|
||||
int32_t max_active;
|
||||
} SherpaOnnxOnlineCtcFstDecoderConfig;
|
||||
|
||||
SHERPA_ONNX_API typedef struct SherpaOnnxHomophoneReplacerConfig {
|
||||
const char *dict_dir;
|
||||
const char *lexicon;
|
||||
const char *rule_fsts;
|
||||
} SherpaOnnxHomophoneReplacerConfig;
|
||||
|
||||
SHERPA_ONNX_API typedef struct SherpaOnnxOnlineRecognizerConfig {
|
||||
SherpaOnnxFeatureConfig feat_config;
|
||||
SherpaOnnxOnlineModelConfig model_config;
|
||||
@@ -157,6 +163,7 @@ SHERPA_ONNX_API typedef struct SherpaOnnxOnlineRecognizerConfig {
|
||||
const char *hotwords_buf;
|
||||
/// byte size excluding the tailing '\0'
|
||||
int32_t hotwords_buf_size;
|
||||
SherpaOnnxHomophoneReplacerConfig hr;
|
||||
} SherpaOnnxOnlineRecognizerConfig;
|
||||
|
||||
SHERPA_ONNX_API typedef struct SherpaOnnxOnlineRecognizerResult {
|
||||
@@ -461,6 +468,8 @@ SHERPA_ONNX_API typedef struct SherpaOnnxOfflineRecognizerConfig {
|
||||
const char *rule_fsts;
|
||||
const char *rule_fars;
|
||||
float blank_penalty;
|
||||
|
||||
SherpaOnnxHomophoneReplacerConfig hr;
|
||||
} SherpaOnnxOfflineRecognizerConfig;
|
||||
|
||||
SHERPA_ONNX_API typedef struct SherpaOnnxOfflineRecognizer
|
||||
|
||||
Reference in New Issue
Block a user