pytries / marisa-trie

Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library.
https://marisa-trie.readthedocs.io/en/latest/
MIT License
1.02k stars 91 forks source link

Removal of has_keys_with_prefix Method #103

Open Amerikranian opened 2 months ago

Amerikranian commented 2 months ago

Hi,

I was looking through the source and saw that has_keys_with_prefix is deprecated and will be removed. Could you elaborate as to why? This seems very useful for if you wanted to fetch a random word of given length from the trie (I myself just so happen to need to do this). Using iterkeys is unacceptable, as it is too slow and gives extraneous information--I only want to know if the given prefix forms a valid path through a tree.

BoboTiG commented 2 months ago

🤔 It was deprecated in fc71f2a68cdedba50654b595807437d5b2f15fda.

I have no strong opinion TBH.

I'll need more inputs from others in order to either:

  1. actually remove the method
  2. keep the method, and remove the deprecation warning
  3. do nothing, keep the current state

I'm OK with option 2 personally.