Code Monkey home page Code Monkey logo

Comments (8)

cmeeren avatar cmeeren commented on July 26, 2024

Additionally, "sa" will match "Aland Islands", and "as" will match "Australia" and "Austria".

from match-sorter.

kentcdodds avatar kentcdodds commented on July 26, 2024

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.

cmeeren avatar cmeeren commented on July 26, 2024

Gotcha. Since I'm not a JS dev and also have very limited time, I'll leave this for someone else.

from match-sorter.

sdbrannum avatar sdbrannum commented on July 26, 2024

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.

kentcdodds avatar kentcdodds commented on July 26, 2024

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.

kentcdodds avatar kentcdodds commented on July 26, 2024

Thanks to @sdbrannum for fixing this!

from match-sorter.

kentcdodds avatar kentcdodds commented on July 26, 2024

@all-contributors please add @cmeeren for bugs

from match-sorter.

allcontributors avatar allcontributors commented on July 26, 2024

@kentcdodds

I've put up a pull request to add @cmeeren! 🎉

from match-sorter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.