Skip to content

Instantly share code, notes, and snippets.

@xrrocha
Created March 5, 2018 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xrrocha/23894a58f20e690adfff28287462b294 to your computer and use it in GitHub Desktop.
Save xrrocha/23894a58f20e690adfff28287462b294 to your computer and use it in GitHub Desktop.
private List<String> edits2(String typo) {
// Repeatedly apply all 4 edits twice, and in parallel, to each split.
// Packing removes duplicates, ensures result presence in dictionary and
// orders by rank
return
pack(edits1(typo).parallelStream()
.flatMap(w -> edits1(w).stream()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment