Match looks for a pattern within a larger text. This implementation of match is fuzzy, meaning it can find a match even if the pattern contains errors and doesn't exactly match what is found in the text. This implementation also accepts an expected location, near which the match should be found. The candidate matches are scored based on a) the number of spelling differences between the pattern and the text and b) the distance between the candidate match and the expected location. The match balance parameter sets the relative importance of these two metrics.
Aproximate pattern to search for in the text. Due to limitations of the Bitap algorithm, the pattern has a limited length.
Aproximately where in the text is the pattern expected to be found?
Determines which is more important, spelling or location. A balance of '0.1' matches nearly exact spelling at almost any location,
a balance of '0.9' matches almost any spelling at nearly the exact location.
At what point does the match algorithm give up. A threshold of '0.1' requires an almost perfect match, a threshold of '0.9' is much more forgiving.