re-pull-request allow tokens and hotwords be loaded from buffered string driectly (#1339)

Co-authored-by: xiao <shawl336@163.com>
This commit is contained in:
lxiao336
2024-09-13 09:58:17 +08:00
committed by GitHub
parent 6b6e7635ed
commit 65cfa7548a
12 changed files with 414 additions and 16 deletions

View File

@@ -19,13 +19,13 @@ namespace sherpa_onnx {
class SymbolTable {
public:
SymbolTable() = default;
/// Construct a symbol table from a file.
/// Construct a symbol table from a file or from a buffered string.
/// Each line in the file contains two fields:
///
/// sym ID
///
/// Fields are separated by space(s).
explicit SymbolTable(const std::string &filename);
explicit SymbolTable(const std::string &filename, bool is_file = true);
#if __ANDROID_API__ >= 9
SymbolTable(AAssetManager *mgr, const std::string &filename);