Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
StringTools[HammingSearch] - find the first approximate occurrences of a string in another string
StringTools[HammingSearchAll] - find all approximate occurrences of a string in another string
Calling Sequence
HammingSearch( pattern, text, hd )
HammingSearchAll( pattern, text, hd )
Parameters
pattern
-
string
text
hd
Hamming distance
Description
The HammingSearch(pattern, text, hd) command locates the first occurrence of a substring of the string text that is close to the string pattern in terms of its Hamming distance from pattern. Specifically, it locates the first such substring whose Hamming distance from pattern is less than or equal to hd. It returns the offset of the occurrence found, or the value if there is no substring of text that is within Hamming distance hd of pattern.
The HammingSearchAll(pattern, text, hd) command locates all occurrences of substrings of the string text that are within Hamming distance hd of the string pattern. An expression sequence of pairs of the form is returned, where offset is the offset of the match, and dist is the Hamming distance of that match to the string pattern.
Note that for , proximity searching degenerates into exact searching, for which StringTools[Search] and StringTools[SearchAll] provide faster algorithms.
Since small Hamming distance bounds hd are most useful in practice, the algorithm is optimized for this case. Furthermore, if , then every possible substring of text with length equal to the length of pattern matches pattern.
For approximate searching using the Levenshtein metric (instead of the Hamming metric), see the StringTools[ApproximateSearch] help page.
Examples
See Also
searchtext, string, StringTools, StringTools[ApproximateSearch], StringTools[ApproximateSearchAll], StringTools[HammingDistance], StringTools[Search], StringTools[SearchAll]
Download Help Document