GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - buriy/python-chartrie: Pure C character trie implementation, wrapped into python extension

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
README
README
 
 
chartrie.c
chartrie.c
 
 
chartrie.pyx
chartrie.pyx
 
 
cysetup.py
cysetup.py
 
 
sample.py
sample.py
 
 
setup.py
setup.py
 
 
stdafx.h
stdafx.h
 
 
trie.c
trie.c
 
 
trie.h
trie.h
 
 

Repository files navigation

=============
CharTrie
=============

This is pure-C version of Trie data structure: http://en.wikipedia.org/wiki/Trie , 
also called "prefix tree", optimized for string keys and int values.

The current interface is the following::

    class CharTrie:
        def __len__(self)
        def __getitem__(self, key)
        def __setitem__(self, key, value)
        def dumps(self)
        def debug_print(self)
        def find(self, key)

    class FrozenCharTrie:
        def __len__(self)
        def __getitem__(self, key)
        def loads(self, stream)
        def debug_print(self)
        def find(self, key) # -> value or None
        def find_prefixes(trie, key) # -> [(position1, value1), (position2, value2), ...]
        def find_splits(self, FrozenCharTrie suffixes, key) # -> [(position1, prefix1, suffix1), (position2, prefix2, suffix2), ...]

Please note, that len(x) returns the number of chars in the trie, not the number of nodes with values.
Also, only values >= 0 are supported (until version 0.2)


------------
Licence: BSD
------------

About

Pure C character trie implementation, wrapped into python extension

Resources

Readme
Activity

Stars

20 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.