Hello,
I am trying to correct spellings. I have some duplicated letter words such as “cooffeeeeeee”. So I am trying to get the actual word. If I enter “cooooooooooffffeeeeee”, instead of giving me “coffee”, it gives me “come” word instead.
However, word “cofee” gives me correct word i.e “coffee”.
I am using this code:
JLanguageTool languageTool = new JLanguageTool(new BritishEnglish());
for (Rule rule : languageTool.getAllRules()) {
if (!rule.isDictionaryBasedSpellingRule()) {
languageTool.disableRule(rule.getId());
}
}
try {
fWord = rec(w);
List<RuleMatch> matches = languageTool.check(fWord);
for (RuleMatch match : matches) {
fWord = match.getSuggestedReplacements().get(0);
}
} catch (IOException x) {
}