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

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR) cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(sherpa-onnx) project(sherpa-onnx)
set(SHERPA_ONNX_VERSION "1.4.2") set(SHERPA_ONNX_VERSION "1.4.3")
# Disable warning about # Disable warning about
# #

View File

@@ -132,7 +132,7 @@ int32_t main(int32_t argc, char *argv[]) {
DestroyOnlineRecognizerResult(r); DestroyOnlineRecognizerResult(r);
DestroyDisplay(display); DestroyDisplay(display);
DestoryOnlineStream(stream); DestroyOnlineStream(stream);
DestroyOnlineRecognizer(recognizer); DestroyOnlineRecognizer(recognizer);
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View File

@@ -391,7 +391,7 @@ int main(int argc, char **argv) {
DestroyOnlineRecognizerResult(r); DestroyOnlineRecognizerResult(r);
DestroyDisplay(display); DestroyDisplay(display);
DestoryOnlineStream(stream); DestroyOnlineStream(stream);
DestroyOnlineRecognizer(recognizer); DestroyOnlineRecognizer(recognizer);
avfilter_graph_free(&filter_graph); avfilter_graph_free(&filter_graph);

View File

@@ -80,7 +80,7 @@ SherpaOnnxOnlineStream *CreateOnlineStream(
return stream; return stream;
} }
void DestoryOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; } void DestroyOnlineStream(SherpaOnnxOnlineStream *stream) { delete stream; }
void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate, void AcceptWaveform(SherpaOnnxOnlineStream *stream, int32_t sample_rate,
const float *samples, int32_t n) { const float *samples, int32_t n) {
@@ -222,7 +222,7 @@ SherpaOnnxOfflineStream *CreateOfflineStream(
return stream; return stream;
} }
void DestoryOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; } void DestroyOfflineStream(SherpaOnnxOfflineStream *stream) { delete stream; }
void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate, void AcceptWaveformOffline(SherpaOnnxOfflineStream *stream, int32_t sample_rate,
const float *samples, int32_t n) { const float *samples, int32_t n) {

View File

@@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
/// ///
/// @param recognizer A pointer returned by CreateOnlineRecognizer() /// @param recognizer A pointer returned by CreateOnlineRecognizer()
/// @return Return a pointer to an OnlineStream. The user has to invoke /// @return Return a pointer to an OnlineStream. The user has to invoke
/// DestoryOnlineStream() to free it to avoid memory leak. /// DestroyOnlineStream() to free it to avoid memory leak.
SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream( SHERPA_ONNX_API SherpaOnnxOnlineStream *CreateOnlineStream(
const SherpaOnnxOnlineRecognizer *recognizer); const SherpaOnnxOnlineRecognizer *recognizer);
/// Destroy an online stream. /// Destroy an online stream.
/// ///
/// @param stream A pointer returned by CreateOnlineStream() /// @param stream A pointer returned by CreateOnlineStream()
SHERPA_ONNX_API void DestoryOnlineStream(SherpaOnnxOnlineStream *stream); SHERPA_ONNX_API void DestroyOnlineStream(SherpaOnnxOnlineStream *stream);
/// Accept input audio samples and compute the features. /// Accept input audio samples and compute the features.
/// The user has to invoke DecodeOnlineStream() to run the neural network and /// The user has to invoke DecodeOnlineStream() to run the neural network and
@@ -303,14 +303,14 @@ SHERPA_ONNX_API void DestroyOfflineRecognizer(
/// ///
/// @param recognizer A pointer returned by CreateOfflineRecognizer() /// @param recognizer A pointer returned by CreateOfflineRecognizer()
/// @return Return a pointer to an OfflineStream. The user has to invoke /// @return Return a pointer to an OfflineStream. The user has to invoke
/// DestoryOfflineStream() to free it to avoid memory leak. /// DestroyOfflineStream() to free it to avoid memory leak.
SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream( SHERPA_ONNX_API SherpaOnnxOfflineStream *CreateOfflineStream(
const SherpaOnnxOfflineRecognizer *recognizer); const SherpaOnnxOfflineRecognizer *recognizer);
/// Destroy an offline stream. /// Destroy an offline stream.
/// ///
/// @param stream A pointer returned by CreateOfflineStream() /// @param stream A pointer returned by CreateOfflineStream()
SHERPA_ONNX_API void DestoryOfflineStream(SherpaOnnxOfflineStream *stream); SHERPA_ONNX_API void DestroyOfflineStream(SherpaOnnxOfflineStream *stream);
/// Accept input audio samples and compute the features. /// Accept input audio samples and compute the features.
/// The user has to invoke DecodeOfflineStream() to run the neural network and /// The user has to invoke DecodeOfflineStream() to run the neural network and

View File

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