private static void addSynonym ( String term , String synonym , Map < String , String [ ] > synonyms ) { term = term . toLowerCase ( ) ; String [ ] syns = synonyms . get ( term ) ; if ( syns == null ) { syns = new String [ ] { synonym } ; } else { String [ ] tmp = new String [ syns . length + 1 ] ; System . arraycopy ( syns , 0 , tmp , 0 , syns . length ) ; tmp [ syns . length ] = synonym ; syns = tmp ; } synonyms . put ( term , syns ) ; }
Adds a synonym definition to the map .