general-sam
A general suffix automaton implementation in Rust.
Python bindings and some utilities are also available.
Please check out general-sam-py.
| The suffix automaton of abcbc, image from 后缀自动机 - OI Wiki. |
Examples
use GeneralSAM;
let sam = construct_from_bytes;
// => GeneralSAM<u8>
assert!;
assert!;
use GeneralSAM;
let sam = construct_from_chars;
// => GeneralSAM<char>
let state = sam.get_root_state;
let state = state.feed_chars;
assert!;
let state = state.feed_chars;
assert!;
let state = state.feed_chars;
assert!;
let state = state.feed_chars;
assert!;
use ;
let mut trie = default;
trie.insert_iter;
trie.insert_iter;
let sam: = construct_from_trie;
assert!;
assert!;
assert!;
assert!;
assert!;
assert!;
assert!;
References
- Mehryar Mohri, Pedro Moreno, Eugene Weinstein. General suffix automaton construction algorithm and space bounds.
- 刘研绎《后缀自动机在字典树上的拓展》
- 广义后缀自动机 - OI Wiki
License
- © 2023 Chielo Newctle <ChieloNewctle@gmail.com>
- © 2023 ModelTC Team
This project is licensed under either of
at your option.
The SPDX license identifier for this project is MIT OR Apache-2.0.