StringTools
PrefixDistance
compute the prefix distance between two strings
SuffixDistance
compute the suffix distance between two strings
Calling Sequence
Parameters
Description
Examples
PrefixDistance( s, t )
SuffixDistance( s, t )
s
-
Maple string
t
The PrefixDistance(s,t) and SuffixDistance(s,t) commands return integer measures of the distance between the two strings s and t.
Let s and t be arbitrary strings. The prefix distance PrefixDistance( s, t ) is defined to be , and the suffix distance is defined, similarly, to be . Both are metrics.
Other string metrics available in this package include StringTools[HammingDistance] and StringTools[Levenshtein].
All of the StringTools package commands treat strings as (null-terminated) sequences of -bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
Being metrics, both PrefixDistance and SuffixDistance satisfy the triangle inequality.
See Also
string
StringTools[CommonPrefix]
StringTools[CommonSuffix]
StringTools[HammingDistance]
StringTools[Levenshtein]
Download Help Document