Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
def computeLevenshtein(wordList: List[String], parallel: Boolean): Array[Array[Int]] = {
maybeParallel(parallel, wordList).map((a) =>
maybeParallel(parallel, wordList).map((b) =>
Levenshtein.lev(a, b)).toArray
).toArray
}
def maybeParallel(parallel: Boolean, wordList: List[String]): GenSeq[String] with Immutable = {
if(parallel)
wordList.par
else
wordList
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment