Skip to content

Latest commit

 

History

History
287 lines (235 loc) · 19.6 KB

fuzzball.md

File metadata and controls

287 lines (235 loc) · 19.6 KB

< back to README

fuzzball

fuzzball~distance(str1, str2, [options_p]) ⇒ number

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

fuzzball~ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~partial_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~token_set_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~partial_token_set_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~token_sort_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~partial_token_sort_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~token_similarity_sort_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~partial_token_similarity_sort_ratio(str1, str2, [options_p]) ⇒ number

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

fuzzball~WRatio(str1, str2, [options_p]) ⇒ number

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

fuzzball~extract(query, choices, [options_p]) ⇒ Array.<Array> | Array.<Object>

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

fuzzball~extractAsync(query, choices, [options_p], callback)

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)