Implements the Levenshtein algorithm for computing string similarity, including distance, edit script, and ratio.