StringTools[ApproximateSearch] - find the first approximate occurrences of a string in another string
StringTools[ApproximateSearchAll] - find all approximate occurrences of a string in another string
|
Calling Sequence
|
|
ApproximateSearch( pattern, text, k )
ApproximateSearchAll( pattern, text, k )
|
|
Parameters
|
|
pattern
|
-
|
string; pattern
|
text
|
-
|
string; text to search
|
k
|
-
|
non-negative integer; maximum edit distance
|
|
|
|
|
Description
|
|
•
|
The ApproximateSearch(pattern, text, k) command locates the first occurrence of a substring of the string text that is close to the string pattern in terms of its Levenshtein distance from pattern. Specifically, it locates the first such substring whose Levenshtein distance from pattern is less than or equal to k.
|
•
|
The ApproximateSearchAll(pattern, text, k) command locates all occurrences of substrings of the string text that are within Levenshtein distance k of the string pattern. An expression sequence of offsets marking the ends of matches is returned.
|
•
|
If , then every possible substring of text with length equal to the length of pattern matches pattern.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
|
|
Download Help Document
Was this information helpful?