fuzzyset.js is a data structure that performs something akin to fulltext search against data to determine likely mispellings and approximate string matching.
The usage is simple. Just add a string to the set, and ask for it later by using
a = FuzzySet();a.add("michael axiak");
[[0.8461538461538461, 'michael axiak']];
The result will be an array of
[score, matched_value] arrays. The score is between 0 and 1, with 1 being a perfect match
- get(value, [default], [minScore=.33]): try to match a string to entries with a score of at least minScore (defaulted to .33), otherwise return null or default if it is given.
- add(value): add a value to the set returning false if it is already in the set.
- length(): return the number of items in the set.
- isEmpty(): returns true if the set is empty.
- values(): returns an array of the values in the set.
The current page is the site's「Google AMP」 View and comment please click：Full Version »
Since this article was not written in the Markdown format editor, the converted page may not conform to the AMP standard.