Skip to content

Commit 5845334

Browse files
hainan-xvdanpovey
authored andcommitted
[src] Fix bug in pruned lattice rescoring when input lattice has epsilons (kaldi-asr#3190)
1 parent 9ef700f commit 5845334

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lat/compose-lattice-pruned.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,14 @@ void PrunedCompactLatticeComposer::ProcessTransition(int32 src_composed_state,
771771
// Note: we expect that ilabel == olabel, since this is a CompactLattice, but this
772772
// may not be so if we extend this to work with Lattice.
773773
fst::StdArc lm_arc;
774-
if (!det_fst_->GetArc(src_info->lm_state, olabel, &lm_arc)) {
774+
775+
// the input lattice might have epsilons
776+
if (olabel == 0) {
777+
lm_arc.ilabel = 0;
778+
lm_arc.olabel = 0;
779+
lm_arc.nextstate = src_info->lm_state;
780+
lm_arc.weight = fst::StdArc::Weight(0.0);
781+
} else if (!det_fst_->GetArc(src_info->lm_state, olabel, &lm_arc)) {
775782
// for normal language models we don't expect this to happen, but the
776783
// appropriate behavior is to do nothing; the composed arc does not exist,
777784
// so there is no arc to add and no new state to create.

0 commit comments

Comments
 (0)