How shner-elmo/flashtext2-rs works
Flashtext2 is a Rust library for registering keywords, extracting matches (optionally with spans), and replacing matched text. The user selects a case-sensitive or case-insensitive KeywordProcessor; both expose the shared trie-based implementation, which tokenizes text on Unicode word boundaries. The README also documents bulk registration and case-insensitive matching. The sampled implementation shows extraction and replacement methods, though its replacement code appends the matched keyword rather than its configured clean word. The graph reflects visible calls and documented capabilities; it does not infer unsampled behavior.
Main entry points: shared.rs Keyword processor · lib.rs Case-sensitive API
Components 7
Other components
- Library user
- Case-sensitive API
src/lib.rs - Case-insensitive API
src/lib.rs - Keyword processor
src/shared.rs - Keyword trie
src/shared.rs - Unicode tokenization
src/shared.rs - Unicode segmentation
Connections 8
- Library user → Case-sensitive API: uses
README.md - Library user → Case-insensitive API: uses
README.md - Case-sensitive API → Keyword processor: exports
src/lib.rs - Case-insensitive API → Keyword processor: exports
src/lib.rs - Keyword processor → Keyword trie: updates
src/shared.rs - Keyword processor → Unicode tokenization: tokenizes with
src/shared.rs - Unicode tokenization → Unicode segmentation: uses
src/shared.rs - Keyword processor → Keyword trie: searches
src/shared.rs