Fangjun Kuang
Committed by GitHub

Fix typos in .Net APIs (#156)

1 cmake_minimum_required(VERSION 3.13 FATAL_ERROR) 1 cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
2 project(sherpa-onnx) 2 project(sherpa-onnx)
3 3
4 -set(SHERPA_ONNX_VERSION "1.4.2") 4 +set(SHERPA_ONNX_VERSION "1.4.3")
5 5
6 # Disable warning about 6 # Disable warning about
7 # 7 #
@@ -132,7 +132,7 @@ int32_t main(int32_t argc, char *argv[]) { @@ -132,7 +132,7 @@ int32_t main(int32_t argc, char *argv[]) {
132 DestroyOnlineRecognizerResult(r); 132 DestroyOnlineRecognizerResult(r);
133 133
134 DestroyDisplay(display); 134 DestroyDisplay(display);
135 - DestoryOnlineStream(stream); 135 + DestroyOnlineStream(stream);
136 DestroyOnlineRecognizer(recognizer); 136 DestroyOnlineRecognizer(recognizer);
137 fprintf(stderr, "\n"); 137 fprintf(stderr, "\n");
138 138
@@ -391,7 +391,7 @@ int main(int argc, char **argv) { @@ -391,7 +391,7 @@ int main(int argc, char **argv) {
391 DestroyOnlineRecognizerResult(r); 391 DestroyOnlineRecognizerResult(r);
392 392
393 DestroyDisplay(display); 393 DestroyDisplay(display);
394 - DestoryOnlineStream(stream); 394 + DestroyOnlineStream(stream);
395 DestroyOnlineRecognizer(recognizer); 395 DestroyOnlineRecognizer(recognizer);
396 396
397 avfilter_graph_free(&filter_graph); 397 avfilter_graph_free(&filter_graph);
@@ -80,7 +80,7 @@ SherpaOnnxOnlineStream *CreateOnlineStream( @@ -80,7 +80,7 @@ SherpaOnnxOnlineStream *CreateOnlineStream(
80 return stream; 80 return stream;
81 } 81 }
82 82
83 -void DestoryOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; } 83 +void DestroyOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; }
84 84
85 void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate, 85 void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate,
86 const float *samples, int32_t n) { 86 const float *samples, int32_t n) {
@@ -222,7 +222,7 @@ SherpaOnnxOfflineStream *CreateOfflineStream( @@ -222,7 +222,7 @@ SherpaOnnxOfflineStream *CreateOfflineStream(
222 return stream; 222 return stream;
223 } 223 }
224 224
225 -void DestoryOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; } 225 +void DestroyOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; }
226 226
227 void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate, 227 void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate,
228 const float *samples, int32_t n) { 228 const float *samples, int32_t n) {
@@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer( @@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
126 /// 126 ///
127 /// @param recognizer A pointer returned by CreateOnlineRecognizer() 127 /// @param recognizer A pointer returned by CreateOnlineRecognizer()
128 /// @return Return a pointer to an OnlineStream. The user has to invoke 128 /// @return Return a pointer to an OnlineStream. The user has to invoke
129 -/// DestoryOnlineStream() to free it to avoid memory leak. 129 +/// DestroyOnlineStream() to free it to avoid memory leak.
130 SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream( 130 SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream(
131 const SherpaOnnxOnlineRecognizer *recognizer); 131 const SherpaOnnxOnlineRecognizer *recognizer);
132 132
133 /// Destroy an online stream. 133 /// Destroy an online stream.
134 /// 134 ///
135 /// @param stream A pointer returned by CreateOnlineStream() 135 /// @param stream A pointer returned by CreateOnlineStream()
136 -SHERPA_ONNX_API void DestoryOnlineStream(SherpaOnnxOnlineStream *stream); 136 +SHERPA_ONNX_API void DestroyOnlineStream(SherpaOnnxOnlineStream *stream);
137 137
138 /// Accept input audio samples and compute the features. 138 /// Accept input audio samples and compute the features.
139 /// The user has to invoke DecodeOnlineStream() to run the neural network and 139 /// The user has to invoke DecodeOnlineStream() to run the neural network and
@@ -303,14 +303,14 @@ SHERPA_ONNX_API void DestroyOfflineRecognizer( @@ -303,14 +303,14 @@ SHERPA_ONNX_API void DestroyOfflineRecognizer(
303 /// 303 ///
304 /// @param recognizer A pointer returned by CreateOfflineRecognizer() 304 /// @param recognizer A pointer returned by CreateOfflineRecognizer()
305 /// @return Return a pointer to an OfflineStream. The user has to invoke 305 /// @return Return a pointer to an OfflineStream. The user has to invoke
306 -/// DestoryOfflineStream() to free it to avoid memory leak. 306 +/// DestroyOfflineStream() to free it to avoid memory leak.
307 SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream( 307 SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream(
308 const SherpaOnnxOfflineRecognizer *recognizer); 308 const SherpaOnnxOfflineRecognizer *recognizer);
309 309
310 /// Destroy an offline stream. 310 /// Destroy an offline stream.
311 /// 311 ///
312 /// @param stream A pointer returned by CreateOfflineStream() 312 /// @param stream A pointer returned by CreateOfflineStream()
313 -SHERPA_ONNX_API void DestoryOfflineStream(SherpaOnnxOfflineStream *stream); 313 +SHERPA_ONNX_API void DestroyOfflineStream(SherpaOnnxOfflineStream *stream);
314 314
315 /// Accept input audio samples and compute the features. 315 /// Accept input audio samples and compute the features.
316 /// The user has to invoke DecodeOfflineStream() to run the neural network and 316 /// The user has to invoke DecodeOfflineStream() to run the neural network and
@@ -36,7 +36,7 @@ func sherpaOnnxOnlineTransducerModelConfig( @@ -36,7 +36,7 @@ func sherpaOnnxOnlineTransducerModelConfig(
36 tokens: String, 36 tokens: String,
37 numThreads: Int = 2, 37 numThreads: Int = 2,
38 debug: Int = 0 38 debug: Int = 0
39 -) -> SherpaOnnxOnlineTransducerModelConfig{ 39 +) -> SherpaOnnxOnlineTransducerModelConfig {
40 return SherpaOnnxOnlineTransducerModelConfig( 40 return SherpaOnnxOnlineTransducerModelConfig(
41 encoder: toCPointer(encoder), 41 encoder: toCPointer(encoder),
42 decoder: toCPointer(decoder), 42 decoder: toCPointer(decoder),
@@ -57,15 +57,15 @@ func sherpaOnnxFeatureConfig( @@ -57,15 +57,15 @@ func sherpaOnnxFeatureConfig(
57 } 57 }
58 58
59 func sherpaOnnxOnlineRecognizerConfig( 59 func sherpaOnnxOnlineRecognizerConfig(
60 - featConfig: SherpaOnnxFeatureConfig,  
61 - modelConfig: SherpaOnnxOnlineTransducerModelConfig,  
62 - enableEndpoint: Bool = false,  
63 - rule1MinTrailingSilence: Float = 2.4,  
64 - rule2MinTrailingSilence: Float = 1.2,  
65 - rule3MinUtteranceLength: Float = 30,  
66 - decodingMethod: String = "greedy_search",  
67 - maxActivePaths: Int = 4  
68 -) -> SherpaOnnxOnlineRecognizerConfig{ 60 + featConfig: SherpaOnnxFeatureConfig,
  61 + modelConfig: SherpaOnnxOnlineTransducerModelConfig,
  62 + enableEndpoint: Bool = false,
  63 + rule1MinTrailingSilence: Float = 2.4,
  64 + rule2MinTrailingSilence: Float = 1.2,
  65 + rule3MinUtteranceLength: Float = 30,
  66 + decodingMethod: String = "greedy_search",
  67 + maxActivePaths: Int = 4
  68 +) -> SherpaOnnxOnlineRecognizerConfig {
69 return SherpaOnnxOnlineRecognizerConfig( 69 return SherpaOnnxOnlineRecognizerConfig(
70 feat_config: featConfig, 70 feat_config: featConfig,
71 model_config: modelConfig, 71 model_config: modelConfig,
@@ -121,7 +121,7 @@ class SherpaOnnxRecognizer { @@ -121,7 +121,7 @@ class SherpaOnnxRecognizer {
121 121
122 deinit { 122 deinit {
123 if let stream { 123 if let stream {
124 - DestoryOnlineStream(stream) 124 + DestroyOnlineStream(stream)
125 } 125 }
126 126
127 if let recognizer { 127 if let recognizer {
@@ -152,7 +152,8 @@ class SherpaOnnxRecognizer { @@ -152,7 +152,8 @@ class SherpaOnnxRecognizer {
152 152
153 /// Get the decoding results so far 153 /// Get the decoding results so far
154 func getResult() -> SherpaOnnxOnlineRecongitionResult { 154 func getResult() -> SherpaOnnxOnlineRecongitionResult {
155 - let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(recognizer, stream) 155 + let result: UnsafeMutablePointer<SherpaOnnxOnlineRecognizerResult>? = GetOnlineStreamResult(
  156 + recognizer, stream)
156 return SherpaOnnxOnlineRecongitionResult(result: result) 157 return SherpaOnnxOnlineRecongitionResult(result: result)
157 } 158 }
158 159