Closed dfuhry closed 1 year ago
Thanks @dfuhry!
Could you rebase on master
, and add at least 2 tests (one when the key is present, and one when it's not preset)?
Oh, I just tilted. You need to run ./update_cpp.sh
. And commit the changes.
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 update_cpp.sh
:)
It seems good now 💪🏻 As soon as the CI is green I'll merge 👍🏻
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.