Comments (8)
Additionally, "sa"
will match "Aland Islands"
, and "as"
will match "Australia"
and "Austria"
.
from match-sorter.
Interesting. I'm not sure what's up.
I'm afraid that I'm not actively using this package so I don't have any time to dedicate to figuring out what the issue is. If you do find what the problem is I welcome you to make a pull request to fix it.
from match-sorter.
Gotcha. Since I'm not a JS dev and also have very limited time, I'll leave this for someone else.
from match-sorter.
I believe this issue is stemming from the use of >=
in reduceItemsToRanked()
paired with getRanking()
found in getClosenessRanking()
function getRanking(spread) {
const matching = spread - stringToRank.length + 1;
const ranking = rankings.MATCHES + 1 / matching
return ranking
}
This function will, in certain cases as mentioned above, return 2 which when compared to the acronym threshold will return the item.
from match-sorter.
Thanks Steven,
Any chance you could make a PR with a failing test first so I can see how this bug plays out in a practical scenario?
from match-sorter.
Thanks to @sdbrannum for fixing this!
from match-sorter.
@all-contributors please add @cmeeren for bugs
from match-sorter.
I've put up a pull request to add @cmeeren! 🎉
from match-sorter.
Related Issues (20)
- Base sort should still be applied if the search string is empty HOT 3
- How to ignore caseRank while sorting? HOT 11
- Match sorter
- Issue with types for nested keys HOT 2
- Unable to import match sorter from versions 5.0.0+ HOT 1
- match fails under certain conditions when keys use different thresholds
- No matches when apostrophe mismatch HOT 1
- `matchSorter` does not accept readonly arrays. HOT 3
- What is the maximum array count for this sorter to perform well? HOT 3
- Return NO_MATCH Items in Alphabetical Order based on Keys HOT 1
- Can't figure out how to generate keys for use with recursive data HOT 3
- Question: Multiple search terms and OR results
- error TS7016: Could not find a declaration file for module 'match-sorter'. '...../node_modules/match-sorter/dist/match-sorter.cjs.js' HOT 4
- Question: ENDS WITH Do you have a match? HOT 1
- Sort array of objects by array of indexes? HOT 1
- Feature request: export `match` and `sort` functions
- feat: return matched pos HOT 2
- Unable to search the word if there are special characters in it HOT 1
- Feature request: typo tolerance HOT 1
- Tip: Search multiple terms (AND filter) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from match-sorter.