Hasty Briefsbeta

Marisa Trie – Static memory-efficient Trie-like structure

14 days ago
  • #Python
  • #Trie
  • #Memory-efficient
  • Static memory-efficient Trie-like structures for Python (3.8+) based on marisa-trie C++ library.
  • String data in a MARISA-trie may take up to 50x-100x less memory than in a standard Python dict.
  • The raw lookup speed is comparable; trie also provides fast advanced methods like prefix search.
  • Alternative Cython-based pip-installable Python bindings are provided.
  • Installation: python -m pip install -U marisa-trie.
  • Limitations include untested mingw32 compiler, slow .prefixes() method, and no .values() method.
  • Wrapper code is licensed under MIT License; bundled marisa-trie C++ library is dual-licensed under LGPL or BSD 2-clause license.