- fuzzball
- ~distance(str1, str2, [options_p]) ⇒
number
- ~ratio(str1, str2, [options_p]) ⇒
number
- ~partial_ratio(str1, str2, [options_p]) ⇒
number
- ~token_set_ratio(str1, str2, [options_p]) ⇒
number
- ~partial_token_set_ratio(str1, str2, [options_p]) ⇒
number
- ~token_sort_ratio(str1, str2, [options_p]) ⇒
number
- ~partial_token_sort_ratio(str1, str2, [options_p]) ⇒
number
- ~token_similarity_sort_ratio(str1, str2, [options_p]) ⇒
number
- ~partial_token_similarity_sort_ratio(str1, str2, [options_p]) ⇒
number
- ~WRatio(str1, str2, [options_p]) ⇒
number
- ~extract(query, choices, [options_p]) ⇒
Array.<Array>
|Array.<Object>
- ~extractAsync(query, choices, [options_p], callback)
- ~distance(str1, str2, [options_p]) ⇒
Calculate levenshtein distance of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein distance (0 and above).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate levenshtein ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate partial levenshtein ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate token set ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.trySimple] | boolean |
try simple/partial ratio as part of (parial_)token_set_ratio test suite |
[options_p.sortBySimilarity] | boolean |
sort tokens by similarity to each other before combining instead of alphabetically |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate partial token ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.trySimple] | boolean |
try simple/partial ratio as part of (parial_)token_set_ratio test suite |
[options_p.sortBySimilarity] | boolean |
sort tokens by similarity to each other before combining instead of alphabetically |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate token sort ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate partial token sort ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate token sort ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate token sort ratio of the two strings.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Calculate weighted ratio of the two strings, taking best score of various methods.
Kind: inner method of fuzzball
Returns: number
- - the levenshtein ratio (0-100).
Param | Type | Description |
---|---|---|
str1 | string |
the first string. |
str2 | string |
the second string. |
[options_p] | Object |
Additional options. |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default true |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
Return the top scoring items from an array (or assoc array) of choices
Kind: inner method of fuzzball
Returns: Array.<Array>
| Array.<Object>
- - array of choice results with their computed ratios (0-100).
Param | Type | Description |
---|---|---|
query | the search term. | |
choices | Array.<String> | Array.<Object> | Object |
array of strings, or array of choice objects if processor is supplied, or object of form {key: choice} |
[options_p] | Object |
Additional options. |
[options_p.scorer] | function |
takes two values and returns a score, will be passed options as 3rd argument |
[options_p.processor] | function |
takes each choice and outputs a value to be used for Scoring |
[options_p.limit] | number |
optional max number of results to return, returns all if not supplied |
[options_p.cutoff] | number |
minimum score that will get returned 0-100 |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default false |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.trySimple] | boolean |
try simple/partial ratio as part of (parial_)token_set_ratio test suite |
[options_p.sortBySimilarity] | boolean |
sort tokens by similarity to each other before combining instead of alphabetically |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.returnObjects] | boolean |
return array of object instead of array of tuples; default false |
Return the top scoring items from an array (or assoc array) of choices
Kind: inner method of fuzzball
Param | Type | Description |
---|---|---|
query | the search term. | |
choices | Array.<String> | Array.<Object> | Object |
array of strings, or array of choice objects if processor is supplied, or object of form {key: choice} |
[options_p] | Object |
Additional options. |
[options_p.scorer] | function |
takes two values and returns a score, will be passed options as 3rd argument |
[options_p.processor] | function |
takes each choice and outputs a value to be used for Scoring |
[options_p.limit] | number |
optional max number of results to return, returns all if not supplied |
[options_p.cutoff] | number |
minimum score that will get returned 0-100 |
[options_p.useCollator] | boolean |
Use Intl.Collator for locale-sensitive string comparison. |
[options_p.astral] | number |
Use astral aware calculation |
[options_p.normalize] | string |
Normalize unicode representations |
[options_p.full_process] | boolean |
Apply basic cleanup, non-alphanumeric to whitespace etc. if true. default true |
[options_p.force_ascii] | boolean |
Strip non-ascii in full_process if true (non-ascii will not become whtespace), only applied if full_process is true as well, default false |
[options_p.collapseWhitespace] | boolean |
Collapse consecutive white space during full_process, default true |
[options_p.trySimple] | boolean |
try simple/partial ratio as part of (parial_)token_set_ratio test suite |
[options_p.sortBySimilarity] | boolean |
sort tokens by similarity to each other before combining instead of alphabetically |
[options_p.wildcards] | string |
characters that will be used as wildcards if provided |
[options_p.returnObjects] | boolean |
return array of object instead of array of tuples; default false |
[options_p.abortController] | Object |
track abortion |
[options_p.cancelToken] | Object |
track cancellation |
[options_p.asyncLoopOffset] | number |
number of rows to run in between every async loop iteration, default 256 |
callback | function |
node style callback (err, arrayOfResults) |