StringTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : String Homology Routines : StringTools/Levenshtein

StringTools

  

Levenshtein

  

compute the Levenshtein distance between two strings

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Levenshtein( s, t )

Parameters

s

-

Maple string

t

-

Maple string

Description

• 

The Levenshtein(s, t) command returns an integer measure of the distance between the two strings s and t.

• 

This distance measure is also known as the edit distance between the strings. It counts the number of edit operations of the following kinds needed to transform the first string into the second.

• 

There are three kinds of edit operations: insertions, deletions, and substitutions. The Levenshtein distance formula assigns each edit operation a weight equal to 1, and computes the length of the shortest sequence of edits needed to transform one string into the other.

Examples

useStringToolsinLevenshteinMathematics,Mathematischeend use

3

(1)

withStringTools:

Levenshteinabc,abd

1

(2)

Levenshteinabc,bca

2

(3)

Levenshteinbrad,angelina

8

(4)

LevenshteinRandom100,'alnum',Random100,'alnum'

96

(5)

See Also

string

StringTools

StringTools[EditDistance]

StringTools[HammingDistance]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam