#trie #fst #path #patricia #radix #style #output

pathtrie

A specialised trie for paths in the style of a Patricia or radix trie

2 releases

0.1.1 Sep 5, 2020
0.1.0 Sep 5, 2020

#1886 in Data structures

Download history 4/week @ 2024-02-11 8/week @ 2024-02-18 44/week @ 2024-02-25 13/week @ 2024-03-03 15/week @ 2024-03-10 6/week @ 2024-03-17

78 downloads per month

MIT/Apache

41KB
1K SLoC

pathtrie

Documentation

A specialised trie for paths in the style of a Patricia or radix trie, with optional optimised FST output.

The intended usage of this data structure is for optimally storing and querying keys that have a large number of shared prefixes, such as file paths in a file system.

This crate is partly inspired by the fst crate by Andrew Gallant. There are a few significant differences to that crate, however:

  • Simplicity of implementation was prioritised over speed
  • The trie structure is mutable and can be later written into an FST
  • Insertions do not need to be in lexicographical order

It is a goal of this project to stabilise the FST format once proven to be bug-free.

Usage

Add this to your Cargo.toml:

[dependencies]
pathtrie = "0.1"

Where is this used?

  • box - a modern replacement for the zip file format

License

Licensed under either of

at your option.

Dependencies

~0.8–1.6MB
~29K SLoC