src/Generic/names/IdFDecoder.cpp
/**
 * Given a set of sentence tokens, _transforms them as necessary_, and
 * then calls decodeSentenceNBestAsGiven -- results end up in theories
 * array one way or another
 */
Given a set of sentence tokens, _transforms them as necessary_, and
then calls decodeSentenceNBestAsGiven -- results end up in theories
array one way or another
Given a set of sentence tokens _transforms them as necessary_ and then calls decodeSentenceNBestAsGiven -- results end up in theories array one way or another
int IdFDecoder::decodeSentenceNBest(IdFSentenceTokens* sentenceTokens, 
									IdFSentenceTheory **theories, 
									int max_theories)
{
	int retval;
	if (_model->useLists()) {
		IdFSentenceTokens translatedTokens;
		translateTokens(sentenceTokens, &translatedTokens);
		if (max_theories > BACKWARD_BEAM_WIDTH)
			max_theories = BACKWARD_BEAM_WIDTH;
		retval = decodeSentenceNBestAsGiven(&translatedTokens, _translatedNBestTheories, max_theories);
		for (int i = 0; i < retval; i++) {
			theories[i] = new IdFSentenceTheory();
			unTranslateTheory(_translatedNBestTheories[i], theories[i], sentenceTokens->getLength());
			delete _translatedNBestTheories[i];
		}
	} else retval = decodeSentenceNBestAsGiven(sentenceTokens, theories, max_theories);
	return retval;
}
int IdFDecoder :: decodeSentenceNBest ( IdFSentenceTokens * sentenceTokens , IdFSentenceTheory * * theories , int max_theories ) { int retval ; if ( _model -> useLists ( ) ) { IdFSentenceTokens translatedTokens ; translateTokens ( sentenceTokens , & translatedTokens ) ; if ( max_theories > BACKWARD_BEAM_WIDTH ) max_theories = BACKWARD_BEAM_WIDTH ; retval = decodeSentenceNBestAsGiven ( & translatedTokens , _translatedNBestTheories , max_theories ) ; for ( int i = 0 ; i < retval ; i ++ ) { theories [ i ] = new IdFSentenceTheory ( ) ; unTranslateTheory ( _translatedNBestTheories [ i ] , theories [ i ] , sentenceTokens -> getLength ( ) ) ; delete _translatedNBestTheories [ i ] ; } } else retval = decodeSentenceNBestAsGiven ( sentenceTokens , theories , max_theories ) ; return retval ; }
Given a set of sentence tokens, _transforms them as necessary_, and
 then calls decodeSentenceNBestAsGiven -- results end up in theories
 array one way or another
Given a set of sentence tokens _transforms them as necessary_ and then calls decodeSentenceNBestAsGiven -- results end up in theories array one way or another
// so that _translatedNBestTheories can have a maximum size...
 //   currently this shouldn't matter, but I don't want to have to track
 //   down a memory corruption bug if someone changes something
 // NB: theories[] will own this pointer
