private List < SequenceState < S , O , D > > retrieveMostLikelySequence ( ) { // Otherwise an HMM break would have occurred and message would be null. assert ! message . isEmpty ( ) ; final S lastState = mostLikelyState ( ) ; // Retrieve most likely state sequence in reverse order final List < SequenceState < S , O , D > > result = new ArrayList <> ( ) ; ExtendedState < S , O , D > es = lastExtendedStates . get ( lastState ) ; while ( es != null ) { final SequenceState < S , O , D > ss = new SequenceState <> ( es . state , es . observation , es . transitionDescriptor ) ; result . add ( ss ) ; es = es . backPointer ; } Collections . reverse ( result ) ; return result ; }
Retrieves most likely sequence from the internal back pointer sequence .