Open deadcoder0904 opened 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.
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! 😄
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
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.tsxYou can see how it shows options available in typefully.app
Let me know if I'm doing anything wrong in my code :)