Inverse text normalization API for other programming languages (#1019)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../go-api-examples/non-streaming-decode-files/run-paraformer-itn.sh
|
||||
@@ -397,6 +397,10 @@ type OfflineRecognizerConfig struct {
|
||||
|
||||
// Used only when DecodingMethod is modified_beam_search.
|
||||
MaxActivePaths int
|
||||
HotwordsFile string
|
||||
HotwordsScore float32
|
||||
RuleFsts string
|
||||
RuleFars string
|
||||
}
|
||||
|
||||
// It wraps a pointer from C
|
||||
@@ -491,6 +495,17 @@ func NewOfflineRecognizer(config *OfflineRecognizerConfig) *OfflineRecognizer {
|
||||
|
||||
c.max_active_paths = C.int(config.MaxActivePaths)
|
||||
|
||||
c.hotwords_file = C.CString(config.HotwordsFile)
|
||||
defer C.free(unsafe.Pointer(c.hotwords_file))
|
||||
|
||||
c.hotwords_score = C.float(config.HotwordsScore)
|
||||
|
||||
c.rule_fsts = C.CString(config.RuleFsts)
|
||||
defer C.free(unsafe.Pointer(c.rule_fsts))
|
||||
|
||||
c.rule_fars = C.CString(config.RuleFars)
|
||||
defer C.free(unsafe.Pointer(c.rule_fars))
|
||||
|
||||
recognizer := &OfflineRecognizer{}
|
||||
recognizer.impl = C.CreateOfflineRecognizer(&c)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user