src/Generic/wordnet/xx_WordNet.cpp
//only new words are added; scores for those already in the 'results' are not changed!!!

only new words are added; scores for those already in the 'results' are not changed
only new words are added ; scores for those already in the ' results ' are not changed
int WordNet::collectNextLevel(SynsetPtr synptr, int level, WordNet::CollectedSynonyms& results) {
	for (int i = 0; i < synptr->wcount; i++) {
		wchar_t wcstr[WORDBUF];
		copychar_towchar(synptr->words[i], wcstr, WORDBUF);
		size_t j=0;
		while ( wcstr[j] != '\0' ) {
			if ( wcstr[j] == '_' ) 
				wcstr[j] = ' ';
			j++;
		}
		if ( results.find(Symbol(wcstr)) == results.end() )
			results[Symbol(wcstr)] = level;
	}
	int n=synptr->wcount;
	if (level == 0) return n;
	SynsetPtr next_level = synptr->ptrlist;
	while (next_level != 0) {
		n += collectNextLevel(next_level, level-1, results);
		next_level = next_level->nextss;
	}
	return n;
}
int WordNet :: collectNextLevel ( SynsetPtr synptr , int level , WordNet :: CollectedSynonyms & results ) { for ( int i = 0 ; i < synptr -> wcount ; i ++ ) { wchar_t wcstr [ WORDBUF ] ; copychar_towchar ( synptr -> words [ i ] , wcstr , WORDBUF ) ; size_t j = 0 ; while ( wcstr [ j ] != ' \0 ' ) { if ( wcstr [ j ] == ' ' ) wcstr [ j ] = ' ' ; j ++ ; } if ( results . find ( Symbol ( wcstr ) ) == results . end ( ) ) results [ Symbol ( wcstr ) ] = level ; } int n = synptr -> wcount ; if ( level == 0 ) return n ; SynsetPtr next_level = synptr -> ptrlist ; while ( next_level != 0 ) { n += collectNextLevel ( next_level , level - 1 , results ) ; next_level = next_level -> nextss ; } return n ; }
only new words are added; scores for those already in the 'results' are not changed!!
only new words are added ; scores for those already in the ' results ' are not changed!!