-
-
Save xrrocha/2436610b65ee459f0feedb7817d84df1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<String> pack(Stream<String> editResults) { | |
return editResults | |
// Remove duplicates | |
.distinct() | |
// Select only words present in dictionary | |
.filter(dictionary::containsKey) | |
// Sort by word rank so more frequent words show first | |
.sorted(Comparator.comparing(dictionary::get)) | |
.collect(toList()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment