Function Levenshtein

  • Calculates the Levenshtein distance of two strings. This function is better than most because it takes utf8 characters into account.

    More information on it can be seen here, on wikipedia.

    Parameters

    • str: string

      The string

    • cmp: string

      The string to compare to

    Returns number

    A "distance" number - the higher, the further str is from cmp