add online-recognizer (#29)

This commit is contained in:
Fangjun Kuang
2023-02-19 12:45:38 +08:00
committed by GitHub
parent d4b0c0590a
commit ebc3b47fb8
11 changed files with 267 additions and 61 deletions

View File

@@ -26,13 +26,14 @@ class OnlineTransducerDecoder {
* to the beginning of the decoding result, which will be
* stripped by calling `StripPrecedingBlanks()`.
*/
virtual OnlineTransducerDecoderResult GetEmptyResult() = 0;
virtual OnlineTransducerDecoderResult GetEmptyResult() const = 0;
/** Strip blanks added by `GetEmptyResult()`.
*
* @param r It is changed in-place.
*/
virtual void StripLeadingBlanks(OnlineTransducerDecoderResult * /*r*/) {}
virtual void StripLeadingBlanks(OnlineTransducerDecoderResult * /*r*/) const {
}
/** Run transducer beam search given the output from the encoder model.
*