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

@@ -33,7 +33,7 @@ static Ort::Value GetFrame(Ort::Value *encoder_out, int32_t t) {
}
OnlineTransducerDecoderResult
OnlineTransducerGreedySearchDecoder::GetEmptyResult() {
OnlineTransducerGreedySearchDecoder::GetEmptyResult() const {
int32_t context_size = model_->ContextSize();
int32_t blank_id = 0; // always 0
OnlineTransducerDecoderResult r;
@@ -43,7 +43,7 @@ OnlineTransducerGreedySearchDecoder::GetEmptyResult() {
}
void OnlineTransducerGreedySearchDecoder::StripLeadingBlanks(
OnlineTransducerDecoderResult *r) {
OnlineTransducerDecoderResult *r) const {
int32_t context_size = model_->ContextSize();
auto start = r->tokens.begin() + context_size;