public Set < String > getSynonyms ( final String canonical ) { Set < String > syn = Sets . newHashSet ( ) ; for ( Map < String , Concept > lexica : lexicon ) { for ( String lexCanonical : lexica . keySet ( ) ) { Set < String > variants = lexica . get ( lexCanonical ) . getVariants ( ) ; for ( String variant : variants ) { if ( canonical . equals ( variant ) ) { for ( String v : variants ) { syn . add ( v . toLowerCase ( ) ) ; } } } } } return syn ; }
given a canonical form ( found with a lex - NER return all variants if any