Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pkufool committed Sep 4, 2023
1 parent 56263da commit a686397
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sherpa-onnx/csrc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@

namespace sherpa_onnx {

/* Encode the hotwords in a input stream to be tokens ids.
*
* @param is The input stream, it contains several lines, one hotwords for each
* line. For each hotword, the tokens (cjkchar or bpe) are separated
* by spaces.
* @symbol_table The tokens table mapping symbols to ids. All the symbols in
* the stream should be in the symbol_table, if not this function
* returns fasle.
*
* @hotwords The encoded ids to be written to.
*
* @return If all the symbols from ``is`` are in the symbol_table, returns true
* otherwise returns false.
*/
bool EncodeHotwords(std::istream &is, const SymbolTable &symbol_table,
std::vector<std::vector<int32_t>> *hotwords);

Expand Down

0 comments on commit a686397

Please sign in to comment.