mtc_token_healing/
lib.rs

1//! 翻转后的 tokens 构成的后缀自动机的 link 树,
2//! 是与 tokens 的前缀树同构的。
3//!
4//! 因此查询某一字符串是哪些 tokens 的前缀,
5//! 等同于查询翻转后的字符串在后缀自动机上走到的状态所对应的 link 树的子树。
6//!
7//! The link tree of a suffix automaton of reversed tokens
8//! is isomorphic to the prefix tree of tokens.
9//!
10//! Thus finding tokens prefixed with a string
11//! is the same as walking to the state on the suffix automaton
12//! and gathering information among the subtree of the link tree.
13mod automaton;
14mod token;
15
16pub use crate::{
17    automaton::VocabPrefixAutomaton,
18    token::{SmallToken, SortedTokenId, SortedTokenRange, TokenId},
19};
20
21#[cfg(test)]
22mod tests;