public String [ ] getSynonyms ( String word ) { String [ ] synonyms = table . get ( word ) ; if ( synonyms == null ) return EMPTY ; String [ ] copy = new String [ synonyms . length ] ; // copy for guaranteed immutability System . arraycopy ( synonyms , 0 , copy , 0 , synonyms . length ) ; return copy ; }
Returns the synonym set for the given word sorted ascending .