Skip to content

Repository files navigation

triehard: Multi-core prefix matching in Python

License: BSD-3 Code style: black

Logo Created with ideogram.ai.

What triehard can do for you: Match fast or die trie-ing

The triehard package provides a very basic proof-of-concept implementation of process-parallel tries. A global trie can be built in a process-parallel manner by merging local tries created on data chunks of the input word list on all available CPU cores. Furthermore, it offers a GUI-based live search for prefix matching on said tries.

Note that this is not really optimized yet in terms of runtime performance.

What you find here

  • data/: Exemplary lists of new-line separated words as text files.

  • triehard/: The package containing the actual implementations

    • trie.py: The trie data structure
    • utils.py: Utility functions
    • gui.py: A basic graphical user interface
  • scripts/: Exemplary usage scripts

    • serial_cli.py: Serial trie-based prefix matching with command-line interface
    • parallel_cli.py: Process-parallel trie-based prefix matching with CLI
    • parallel_gui.py: Process-parallel trie-based prefix matching with graphical user interface
    • parallel_live.py: Process-parallel trie-based prefix matching with live search and GUI
  • benchmark/: Scripts to benchmark the implementations

  • snippets/: Potentially useful code snippets (not relevant for users).

  • tests/: This folder will maybe contain unit and integration test in the future.

Installation

To install the triehard package, clone this repo and run pip install -e . or python setup.py install.

About

Match fast or die trie-ing: A multi-core prefix matcher in Python.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages