Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set threshold for matching to kick in #12

Open
eklem opened this issue Jul 9, 2020 · 2 comments
Open

set threshold for matching to kick in #12

eklem opened this issue Jul 9, 2020 · 2 comments

Comments

@eklem
Copy link
Owner

eklem commented Jul 9, 2020

i.e. matchThreshold: 3

@eklem
Copy link
Owner Author

eklem commented Jul 9, 2020

Make it a configurable property. Maybe combine with different Levenshtein distance for different length words.

An example would be no matching for words with less than 5 letters, 1 as distance for 5-7 letter words, 2 as distance for 7-10 letter words and 3 as distance for all words with 11 or more letters.

@eklem
Copy link
Owner Author

eklem commented Mar 8, 2024

so:

const options = {
  threshold: 3, // matching kicks in at 3 letter words and bigger
  distanceType: `percentage` // absolute/percentage - absolute is default to be backwards compatible
  distance: 33 // Levenshtein distance. If percentage, this is percentage of word length. Rounded to closest integer. If absolute, this is the...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant