public final static void appendSynonyms ( LinkedList < IWord > wordPool , IWord wd ) { List < IWord > synList = wd . getSyn ( ) . getList ( ) ; synchronized ( synList ) { for ( int j = 0 ; j < synList . size ( ) ; j ++ ) { IWord curWord = synList . get ( j ) ; if ( curWord . getValue ( ) . equals ( wd . getValue ( ) ) ) { continue ; } IWord synWord = synList . get ( j ) . clone ( ) ; synWord . setPosition ( wd . getPosition ( ) ) ; wordPool . add ( synWord ) ; } } }
quick interface to do the synonyms append word You got check if the specified has any synonyms first