src/Generic/names/IdFSentenceTokens.cpp
/**
 * Fills in _wordArray for next sentence in stream (not used in SERIF)
 * 
 * @return true if successful in reading new sentence, false if EOF or other error
 */
Fills in _wordArray for next sentence in stream (not used in SERIF)

@return true if successful in reading new sentence, false if EOF or other error
Fills in _wordArray for next sentence in stream ( not used in SERIF ) @return true if successful in reading new sentence false if EOF or other error
bool IdFSentenceTokens::readDecodeSentence(UTF8InputStream& stream) {
	UTF8Token token;
	if (stream.eof())
		return false;
	stream >> token;
	if (stream.eof())
		return false;
	if (token.symValue() != SymbolConstants::leftParen)
		throw UnexpectedInputException("IdFSentenceTokens::readDecodeSentence", 
		"ill-formed sentence");
	_length = 0;
	while (true) {
		stream >> token;
		if (token.symValue() == SymbolConstants::rightParen)
			break;
		if (_length < MAX_LENGTH) {
			_wordArray[_length] = token.symValue();
			_constraints[_length] = false;
		}
		_length++;
	}
	if (_length >= MAX_LENGTH) {
		std::cerr << "truncating sentence with " << _length << " tokens\n";
		_length = MAX_LENGTH-1;
	}
	return true;
}
bool IdFSentenceTokens :: readDecodeSentence ( UTF8InputStream & stream ) { UTF8Token token ; if ( stream . eof ( ) ) return false ; stream >> token ; if ( stream . eof ( ) ) return false ; if ( token . symValue ( ) != SymbolConstants :: leftParen ) throw UnexpectedInputException ( " " , " " ) ; _length = 0 ; while ( true ) { stream >> token ; if ( token . symValue ( ) == SymbolConstants :: rightParen ) break ; if ( _length < MAX_LENGTH ) { _wordArray [ _length ] = token . symValue ( ) ; _constraints [ _length ] = false ; } _length ++ ; } if ( _length >= MAX_LENGTH ) { std :: cerr << " " << _length << " \n " ; _length = MAX_LENGTH - 1 ; } return true ; }
Fills in _wordArray for next sentence in stream (not used in SERIF)
Fills in _wordArray for next sentence in stream ( not used in SERIF )
// expected sample sentence:
 // (the United Nations succeeded .)
