Extended, adaptable implementation of the Levenshtein distance algorithm