Added tokens, tokens_arr and json for offline recongnizer result (#936)
Co-authored-by: leo <webmaster@360converter.com>
This commit is contained in:
@@ -481,7 +481,27 @@ SHERPA_ONNX_API typedef struct SherpaOnnxOfflineRecognizerResult {
|
||||
|
||||
// number of entries in timestamps
|
||||
int32_t count;
|
||||
// TODO(fangjun): Add more fields
|
||||
|
||||
// Pointer to continuous memory which holds string based tokens
|
||||
// which are separated by \0
|
||||
const char *tokens;
|
||||
|
||||
// a pointer array containing the address of the first item in tokens
|
||||
const char *const *tokens_arr;
|
||||
|
||||
/** Return a json string.
|
||||
*
|
||||
* The returned string contains:
|
||||
* {
|
||||
* "text": "The recognition result",
|
||||
* "tokens": [x, x, x],
|
||||
* "timestamps": [x, x, x],
|
||||
* "segment": x,
|
||||
* "start_time": x,
|
||||
* "is_final": true|false
|
||||
* }
|
||||
*/
|
||||
const char *json;
|
||||
} SherpaOnnxOfflineRecognizerResult;
|
||||
|
||||
/// Get the result of the offline stream.
|
||||
|
||||
Reference in New Issue
Block a user