From 26af3b292d10ea77590c578dcded343a0fad75fc Mon Sep 17 00:00:00 2001 From: dabinat Date: Fri, 22 Mar 2019 10:08:13 -0700 Subject: [PATCH] API - Minor cleanup --- native_client/deepspeech.cc | 6 +++--- native_client/deepspeech.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native_client/deepspeech.cc b/native_client/deepspeech.cc index c736b2e9..c1bb075e 100644 --- a/native_client/deepspeech.cc +++ b/native_client/deepspeech.cc @@ -181,7 +181,7 @@ struct ModelState { * * @return Vector of Output structs directly from the CTC decoder for additional processing. */ - vector decode_raw(vector& logits); + vector decode_raw(const vector& logits); /** * @brief Return character-level metadata including letter timings. @@ -190,7 +190,7 @@ struct ModelState { * n_frames * batch_size * num_classes * * @return Metadata struct containing MetadataItem structs for each character. - * The user is responsible for freeing Metadata and Metadata.items. + * The user is responsible for freeing Metadata by calling DS_FreeMetadata(). */ Metadata* decode_metadata(vector& logits); @@ -463,7 +463,7 @@ ModelState::decode(vector& logits) } vector -ModelState::decode_raw(vector& logits) +ModelState::decode_raw(const vector& logits) { const int cutoff_top_n = 40; const double cutoff_prob = 1.0; diff --git a/native_client/deepspeech.h b/native_client/deepspeech.h index e0d52d94..acb01ecc 100644 --- a/native_client/deepspeech.h +++ b/native_client/deepspeech.h @@ -133,7 +133,7 @@ char* DS_SpeechToText(ModelState* aCtx, * @param aSampleRate The sample-rate of the audio signal. * * @return Outputs a struct of individual letters along with their timing information. - * The user is responsible for freeing Metadata and Metadata.items. Returns NULL on error. + * The user is responsible for freeing Metadata by calling {@link DS_FreeMetadata()}. Returns NULL on error. */ DEEPSPEECH_EXPORT Metadata* DS_SpeechToTextWithMetadata(ModelState* aCtx, @@ -209,7 +209,7 @@ char* DS_FinishStream(StreamingState* aSctx); * @param aSctx A streaming state pointer returned by {@link DS_SetupStream()}. * * @return Outputs a struct of individual letters along with their timing information. - * The user is responsible for freeing Metadata and Metadata.items. Returns NULL on error. + * The user is responsible for freeing Metadata by calling {@link DS_FreeMetadata()}. Returns NULL on error. * * @note This method will free the state pointer (@p aSctx). */