Fix typos in .Net APIs (#156)

This commit is contained in:
Fangjun Kuang
2023-05-14 22:32:01 +08:00
committed by GitHub
parent b8fbf8e5ce
commit 959f13eac8
6 changed files with 22 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ func sherpaOnnxOnlineTransducerModelConfig(
tokens: String,
numThreads: Int = 2,
debug: Int = 0
) -> SherpaOnnxOnlineTransducerModelConfig{
) -> SherpaOnnxOnlineTransducerModelConfig {
return SherpaOnnxOnlineTransducerModelConfig(
encoder: toCPointer(encoder),
decoder: toCPointer(decoder),
@@ -57,15 +57,15 @@ func sherpaOnnxFeatureConfig(
}
func sherpaOnnxOnlineRecognizerConfig(
featConfig: SherpaOnnxFeatureConfig,
modelConfig: SherpaOnnxOnlineTransducerModelConfig,
enableEndpoint: Bool = false,
rule1MinTrailingSilence: Float = 2.4,
rule2MinTrailingSilence: Float = 1.2,
rule3MinUtteranceLength: Float = 30,
decodingMethod: String = "greedy_search",
maxActivePaths: Int = 4
) -> SherpaOnnxOnlineRecognizerConfig{
featConfig: SherpaOnnxFeatureConfig,
modelConfig: SherpaOnnxOnlineTransducerModelConfig,
enableEndpoint: Bool = false,
rule1MinTrailingSilence: Float = 2.4,
rule2MinTrailingSilence: Float = 1.2,
rule3MinUtteranceLength: Float = 30,
decodingMethod: String = "greedy_search",
maxActivePaths: Int = 4
) -> SherpaOnnxOnlineRecognizerConfig {
return SherpaOnnxOnlineRecognizerConfig(
feat_config: featConfig,
model_config: modelConfig,
@@ -121,7 +121,7 @@ class SherpaOnnxRecognizer {
deinit {
if let stream {
DestoryOnlineStream(stream)
DestroyOnlineStream(stream)
}
if let recognizer {
@@ -152,7 +152,8 @@ class SherpaOnnxRecognizer {
/// Get the decoding results so far
func getResult() -> SherpaOnnxOnlineRecongitionResult {
let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(recognizer, stream)
let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(
recognizer, stream)
return SherpaOnnxOnlineRecongitionResult(result: result)
}