Support replacing homonphonic phrases (#2153)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "kaldifst/csrc/text-normalizer.h"
|
||||
#include "sherpa-onnx/csrc/homophone-replacer.h"
|
||||
#include "sherpa-onnx/csrc/macros.h"
|
||||
#include "sherpa-onnx/csrc/offline-recognizer.h"
|
||||
#include "sherpa-onnx/csrc/offline-stream.h"
|
||||
@@ -48,12 +49,15 @@ class OfflineRecognizerImpl {
|
||||
|
||||
std::string ApplyInverseTextNormalization(std::string text) const;
|
||||
|
||||
std::string ApplyHomophoneReplacer(std::string text) const;
|
||||
|
||||
private:
|
||||
OfflineRecognizerConfig config_;
|
||||
// for inverse text normalization. Used only if
|
||||
// config.rule_fsts is not empty or
|
||||
// config.rule_fars is not empty
|
||||
std::vector<std::unique_ptr<kaldifst::TextNormalizer>> itn_list_;
|
||||
std::unique_ptr<HomophoneReplacer> hr_;
|
||||
};
|
||||
|
||||
} // namespace sherpa_onnx
|
||||
|
||||
Reference in New Issue
Block a user