chapmankyle / emoji-set

Emoji library that allows for searching by emoji, group or keyword :mag:
https://www.npmjs.com/package/emoji-set
GNU General Public License v3.0
5 stars 0 forks source link

x shows no emoji #6

Open deadcoder0904 opened 3 years ago

deadcoder0904 commented 3 years ago

Hey @chapmankyle, awesome stuff. I was gonna think of creating one using the same wrappers but you beat me by 20 days.

I tried using x but it shows nothing. See this demo -> https://stackblitz.com/edit/react-ts-uucibv?file=index.tsx

You can see how it shows options available in typefully.app

emoji-picker

Let me know if I'm doing anything wrong in my code :)

deadcoder0904 commented 3 years ago

Oh, it does match if it startsWith a keyword so it makes sense. Try using a fuzzy-search algorithm.

I recently read here that Aho-Corasick is a good algorithm & this is the fastest Node.js implementation but I think it matches keywords. Would need to find something similar for characters in keywords.

chapmankyle commented 3 years ago

Oh, it does match if it startsWith a keyword so it makes sense. Try using a fuzzy-search algorithm.

I recently read here that Aho-Corasick is a good algorithm & this is the fastest Node.js implementation but I think it matches keywords. Would need to find something similar for characters in keywords.

Hey @deadcoder0904, funnily enough I actually noticed this exact issue also when searching for 'x'

I am in the process of reviewing and adding more keywords to each emoji now (might take a bit of a while though as there is roughly 15k lines in src/all.json) and then I will definitely look into using a fuzzy-search algorithm, thank you for the suggestion! 😄

deadcoder0904 commented 3 years ago

Cool, let me know when you do get around it.

PS: Here is the fastest fuzzy library in JS -> https://github.com/axules/fuzzy-tools