src/Generic/names/IdFDecoder.cpp
/**
 * Given a set of sentence tokens, decodes over them and places best result 
 * in the given IdFSentenceTheory 
 */
Given a set of sentence tokens, decodes over them and places best result
in the given IdFSentenceTheory
Given a set of sentence tokens decodes over them and places best result in the given IdFSentenceTheory
int IdFDecoder::decodeSentenceAsGiven(IdFSentenceTokens* sentenceTokens, 
							          IdFSentenceTheory *sentenceTheory) 
{
	sentenceTheory->setLength(sentenceTokens->getLength());
    int back_pointer = walkForwardThroughSentence(sentenceTokens);
	if (back_pointer == -1) {
		for (int i = 0; i < sentenceTokens->getLength(); i++) {
			sentenceTheory->setTag(i, _nameClassTags->getNoneStartTagIndex());
		}
		sentenceTheory->setBestPossibleScore(-10000);
		return 0;
	}
	for (int sent_index = sentenceTokens->getLength() - 1; sent_index >= 0; sent_index--) {
		sentenceTheory->setTag(sent_index, back_pointer);
		back_pointer = _backPointers[back_pointer][sent_index];
	}
	sentenceTheory->setBestPossibleScore(_best_alpha_prob);		
	return 1;
}
int IdFDecoder :: decodeSentenceAsGiven ( IdFSentenceTokens * sentenceTokens , IdFSentenceTheory * sentenceTheory ) { sentenceTheory -> setLength ( sentenceTokens -> getLength ( ) ) ; int back_pointer = walkForwardThroughSentence ( sentenceTokens ) ; if ( back_pointer == -1 ) { for ( int i = 0 ; i < sentenceTokens -> getLength ( ) ; i ++ ) { sentenceTheory -> setTag ( i , _nameClassTags -> getNoneStartTagIndex ( ) ) ; } sentenceTheory -> setBestPossibleScore ( -10000 ) ; return 0 ; } for ( int sent_index = sentenceTokens -> getLength ( ) - 1 ; sent_index >= 0 ; sent_index -- ) { sentenceTheory -> setTag ( sent_index , back_pointer ) ; back_pointer = _backPointers [ back_pointer ] [ sent_index ] ; } sentenceTheory -> setBestPossibleScore ( _best_alpha_prob ) ; return 1 ; }
Given a set of sentence tokens, decodes over them and places best result
 in the given IdFSentenceTheory
Given a set of sentence tokens decodes over them and places best result in the given IdFSentenceTheory
// no valid path found
