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

Migrate to a better matching engine #1032

Closed
jamesgeorge007 opened this issue Mar 18, 2020 · 4 comments
Closed

Migrate to a better matching engine #1032

jamesgeorge007 opened this issue Mar 18, 2020 · 4 comments
Assignees

Comments

@jamesgeorge007
Copy link
Contributor

As of now meant is made use for finding the closest match to an unknown command which isn't actively maintained anymore.

var bestSimilarity = meant(scmd, commands).map(function (str) {

A better replacement would be leven

@jamesgeorge007
Copy link
Contributor Author

@isaacs this would be a good candidate for v7 release. I can work on a PR 👍

@isaacs
Copy link
Contributor

isaacs commented Mar 19, 2020

It's relatively isolated, and the core team doesn't have any plans to get to it as a v7 beta release blocker, so yeah! go for it!

  • New implementation should have tests, with full coverage of all newly added lib code. (Even if the old implementation doesn't have full coverage, or any tests at all.)
  • It would be good to understand why leven would be better. What's "better" about it? Faster? Closer matches? Fewer bugs? (Do those bugs affect us?) etc.

@watilde
Copy link
Contributor

watilde commented Oct 26, 2020

I just noticed #1071 is merged and I'm curious about this part: What's "better" about it? asked by @isaacs and would love to get feedback for further improvements as meant was designed to use in npm at npm/npm#10382. I'm sharing some facts I gathered in the below and still believe that it's hard to find a strong reason why it's already migrated so far.

Size

  • leven: 224b
  • meant: 288b
    • By deleting test file, .github directory and CHANGELOG as same as leven, it becomes 192b. Can be quickly done if this is a critical.

Last update

Coverage

Perfomance

  • Cannot directly compare as leven does only distance calc and meant does suggestion of a similar command(Refs: added loop by the migration). For the distance calc, it should be almost the same.

Closer matches

  • Should be the same as it uses the same algo for calc part.

In addition, I'm happy to migrate meant repository to npm's org + provide npm members with its publish permission on registry if it helps npm community :)

cc @isaacs @jamesgeorge007 @ruyadorno

@watilde
Copy link
Contributor

watilde commented Mar 27, 2021

I wish I could hear back any feedback

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

Successfully merging a pull request may close this issue.

4 participants