Skip to content

Commit

Permalink
speller: lesser prio to short words from user dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaumeortola committed Apr 17, 2024
1 parent db51dba commit add8cee
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,13 @@ private List<SuggestedReplacement> calcSpellerSuggestions(String word, boolean f
userSuggestions = filterDupes(userSuggestions);
defaultSuggestions = orderSuggestions(defaultSuggestions, word);

return Lists.newArrayList(Iterables.concat(userSuggestions, defaultSuggestions));
if (word.length()>4) {
return Lists.newArrayList(Iterables.concat(userSuggestions, defaultSuggestions));
} else {
// Don't use short words from user dictionaries because they usually hide the best suggestions
return Lists.newArrayList(Iterables.concat(defaultSuggestions, userSuggestions));
}

}

protected void addHyphenSuggestions(String[] split, List<SuggestedReplacement> topSuggestions) throws IOException {
Expand Down

0 comments on commit add8cee

Please sign in to comment.