Limiting spelling suggesions to the five cloest matches

This commit is contained in:
Brendan Robert 2015-09-12 23:22:15 -05:00
parent 38e8a0dcc7
commit 287ceca85f

View File

@ -246,8 +246,8 @@ public class MythosEditor {
result.getCorrections().forEach((SpellResponse.Source source, Set<Suggestion> suggestions) -> {
message
.append(source.word)
.append(" : ")
.append(suggestions.stream().map(Suggestion::getWord).collect(Collectors.joining(", ")))
.append(": ")
.append(suggestions.stream().map(Suggestion::getWord).limit(5).collect(Collectors.joining(",")))
.append("\n");
});
return message.toString();