public ArrayList < String > findReplacements ( String word ) { final List < CandidateData > result = findReplacementCandidates ( word ) ; final ArrayList < String > resultSuggestions = new ArrayList < String > ( result . size ( ) ) ; for ( CandidateData cd : result ) { resultSuggestions . add ( cd . getWord ( ) ) ; } return resultSuggestions ; }
Find suggestions by using K . Oflazer s algorithm . See Jan Daciuk s s_fsa package spell . cc for further explanation .