Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
static int[][] computeLevenshtein(List<String> wordList, boolean parallel) {
final int LIST_SIZE = wordList.size();
int[][] distances = new int[LIST_SIZE][LIST_SIZE];
Supplier<Stream<String>> streamSupplier = parallel ? wordList::parallelStream : wordList::stream;
.map(a -> streamSupplier.get()
.mapToInt(b -> Levenshtein.lev(a, b))
return distances;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.