fuzzyset.js – Fuzzy String Set for JavaScript

samuel Text & String 215 , , , , ,

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 .get:

a = FuzzySet();a.add("michael axiak");
a.get("micael asiak");
[[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.
Related Post

slugify is a javascript library to slugify string. It's useful for URLs, filenames, and IDs. Usage: slugify('I ♥ Dogs'); //=> Read more

Underscore.string is a string manipulation helpers for javascript. Originally started as an Underscore.js extension but is a full standalone library Read more

Voca is a JavaScript library for manipulating strings. The Voca library offers helpful functions to make string manipulations comfortable: change case, Read more

strman is a javascript string manipulation library without npm dependences. append appendArray at between chars collapseWhitespace contains containsAll containsAny countSubstr Read more

jQuery.mark is a jQuery plugin to highlight text with diacritics, synonyms, custom elements, custom class names, separate word search (multiple Read more

jQuery Filter Table Plugin is a live searching/filtering for HTML tables in a jQuery plugin. This plugin will add a search Read more

Javascript technique that is scanning the DOM of a page for text equivalents and showing the actual parts of the Read more

HideSeek is simple, yet customizable jQuery plugin for live search, is compatible with IE7+, Chrome, Firefox, Safari and supports highlighting, Read more