Dadoou
Committed by GitHub

Update offline-ctc-greedy-search-decoder.cc (#917)

Bug fixes.
Z_O_O will be decoded as ZO instead of ZOO.
To fix this, prev_id should update every time.
@@ -42,8 +42,8 @@ std::vector<OfflineCtcDecoderResult> OfflineCtcGreedySearchDecoder::Decode( @@ -42,8 +42,8 @@ std::vector<OfflineCtcDecoderResult> OfflineCtcGreedySearchDecoder::Decode(
42 if (y != blank_id_ && y != prev_id) { 42 if (y != blank_id_ && y != prev_id) {
43 r.tokens.push_back(y); 43 r.tokens.push_back(y);
44 r.timestamps.push_back(t); 44 r.timestamps.push_back(t);
45 - prev_id = y;  
46 } 45 }
  46 + prev_id = y;
47 } // for (int32_t t = 0; ...) 47 } // for (int32_t t = 0; ...)
48 48
49 ans.push_back(std::move(r)); 49 ans.push_back(std::move(r));