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)
project(sherpa-onnx)
set(SHERPA_ONNX_VERSION "1.4.2")
set(SHERPA_ONNX_VERSION "1.4.3")
# Disable warning about
#

View File

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

View File

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

View File

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

View File

@@ -126,14 +126,14 @@ SHERPA_ONNX_API void DestroyOnlineRecognizer(
///
/// @param recognizer A pointer returned by CreateOnlineRecognizer()
/// @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(
const SherpaOnnxOnlineRecognizer *recognizer);
/// Destroy an online stream.
///
/// @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.
/// 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()
/// @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(
const SherpaOnnxOfflineRecognizer *recognizer);
/// Destroy an offline stream.
///
/// @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.
/// The user has to invoke DecodeOfflineStream() to run the neural network and

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)
}