-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add Trie iter_prefixes_with_ids method to return (prefix, id) pairs #83
Conversation
Thanks @dfuhry! Could you rebase on |
Oh, I just tilted. You need to run |
Hi @BoboTiG , thank you for the help. I have added a new test_iter_prefixes_with_keys() method in tests/test_trie.py which tests the cases you requested. I've also tried to rebase, which I guess I've done right as my branch doesn't show being behind on commits any more. To rebuild the cpp scripts I had to change the command in update_cpp.sh from "cython" to "cython3" locally. Not sure if that creates any problems. If not, not sure if you want me to add that change to this branch. |
Can you rebuild using Cython 0.29.32? |
And no need to push the change from |
It seems good now 💪🏻 |
Thanks a lot for your patience @dfuhry :) |
Thank you! |
I'll try to cut a new release ASAP. |
I would like to get both prefixes and ids (from common_prefix_search) in a single pass through the trie data structure.
Trie has iteritems() method to return (prefix, id) pairs from _trie.predictive_search(). However, there is no corresponding method to return (prefix, id) pairs from _trie.common_prefix_search().
This pull request adds a Trie iter_prefixes_with_ids() method which does that.