Crate suffix_tree [−] [src]
Suffix tree construction in linear time. Usage is very simple:
use suffix_tree::SuffixTree; let tree = SuffixTree::new("banana"); println!("{:?}", tree);
There is a command line utility included in this repository called
stree
that will write a suffix tree in GraphViz's dot
format. From
there, it's very easy to visualize it:
stree "banana" | dot -Tpng > banana.png
Note that while there are lots of iterators defined for suffix trees in this crate, there is no useful interface for searching text. Namely, suffix tree support is very experimental and my current implementation seems extremely wasteful and not well designed.
The construction algorithm takes linear time and space. (It first builds a suffix array and converts that to a tree in linear time.)
Structs
Ancestors |
An iterator over ancestors of a node. |
Children |
An iterator over all children of a node. |
Leaves |
An iterator over all leaves of a node. |
Node |
A node in a suffix tree. |
Preorder |
An iterator over all children of a node in preorder. |
SuffixTree |
A suffix tree. |
SuffixTreeIndices |
An iterator over all suffix indices below a node. |