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

The ramdajs.com/docs/'s Filter input is not smart enough for filtering what I really want. #182

Open
adispring opened this issue Jun 7, 2017 · 3 comments
Assignees

Comments

@adispring
Copy link
Member

When searching o in Filter input of ramdajs.com/docs/, what I really want is R.o, but it is not on top of the result list. Can anyone optimize the filter algorithm?

@buzzdecafe
Copy link
Member

Thanks for moving this issue. Looks like there is not much to the filter alg at the moment. It simply matches the input string vs. the list of functions, and hides any elements that do not match. This appears to be the code that does it:

https://github.com/ramda/ramda.github.io/blob/master/docs/main.js#L22

@kedashoe
Copy link
Contributor

kedashoe commented Jun 7, 2017

I'm actually working on some related stuff. I'll get to this at some point soon-ish

@kedashoe kedashoe self-assigned this Jun 7, 2017
@adispring
Copy link
Member Author

adispring commented Jun 8, 2017

We can give each matched api with different weight using regex.
For example, each api's weight starts with 0, if api's name begins with input characters, its weight +2; else if ends with input characters, weight +1.
Then sort matched apis with weight and alphabetical order, weight first.

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

No branches or pull requests

4 participants