finding words similar to words already in dictonary
jaumeortola opened this issue · 3 comments
I would like to use the Morfologik speller to find words similar to words that are already in the dictionary. It would be necessary just to remove the condition && !isInDictionary(word)
here: https://github.com/morfologik/morfologik-stemming/blob/master/morfologik-speller/src/main/java/morfologik/speller/Speller.java#L410
I am already doing it adding a diacritic to the word (i.e. adding a spelling error to the right word), and it works as expected most of the time, but not always (for example, if there is a transposition).
We need to add something like:
public ArrayList<CandidateData> findReplacementCandidates(String word, boolean evenIfWordIsInDictonary) {
Is that okay, @dweiss? I will provide a pull-request.
I'm not sure I understand what you'd like to add, but I think it'd be better to create a different method than modify existing one. This would keep the API compatible and perhaps the name of the method could reflect its true purpose?
but I think it'd be better to create a different method than modify existing one. This would keep the API compatible and perhaps the name of the method could reflect its true purpose?
Thanks for the answer. The API will be compatible, of course. The new method could be named findSimilarWords(String word)
.
Sure, why not then.