code: 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);
     }
docs: Adds a synonym definition to the map.
  
  @param term     the term
  @param synonym  synonym for <code>term</code>.
  @param synonyms the Map containing the synonyms.