Welcome to gen-trie’s documentation! | gen-tries 0.5.0 documentation

Skip to content

# Welcome to gen-trie’s documentation!

gen-trie is a Python library for creating and manipulating ‘generalized’ trie data structures.

Unlike common trie implementations that only support strings as keys, this generalized trie can handle various types of tokens in keys, as long as they are hashable.

Check out the Using gen-trie section for further information, including how to do Installation of the project.

Note

This project is under active development and the API may change. Please refer to the documentation for the most up-to-date information.

## Contents

- Using gen-trie
  - Installation
  - Usage
    - Examples
      - By Letter
      - By Number
      - By Tuple
      - By Word
      - Key In Trie
      - Prefixes
      - Suffixes
      - URL Suffixes
      - Word Suggestions
      - Trie of numeric vectors
- gentrie package
  - Module contents
    - Usage
      - Example 1 - Basic Usage
      - Example 2 - Trie of URLs
      - Example 3 - Suffixes of a Key
    - `DuplicateKeyError`
    - `GeneralizedKey`
    - `GeneralizedTrie`
      - `GeneralizedTrie.add()`
      - `GeneralizedTrie.clear()`
      - `GeneralizedTrie.items()`
      - `GeneralizedTrie.keys()`
      - `GeneralizedTrie.prefixes()`
      - `GeneralizedTrie.remove()`
      - `GeneralizedTrie.suffixes()`
      - `GeneralizedTrie.update()`
      - `GeneralizedTrie.values()`
    - `Hashable`
    - `InvalidGeneralizedKeyError`
    - `InvalidTrieKeyTokenError`
    - `TRIE_IDENT`
    - `TRIE_KEY`
    - `TRIE_VALUE`
    - `TrieEntry`
      - `TrieEntry.ident`
      - `TrieEntry.key`
      - `TrieEntry.value`
    - `TrieId`
    - `TrieKeyToken`
    - `is_generalizedkey()`
    - `is_hashable()`
    - `is_triekeytoken()`