Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ Major release with breaking changes.
`NewmmTokenizer`, `NewmmFstTokenizer`, and `DeepcutTokenizer`.
- Added better parallel processing controls for large input.
- Added CLI tokenizer selection (`newmm`, `nf`, `deepcut`).
- **`TrieChar` memory optimization**: removed the parallel `HashSet<String>`
word store. Words are now encoded exclusively in the trie structure,
eliminating per-word duplicate string allocations (~92 bytes per word for
Thai text, ~12% total reduction for 62k-word dictionary). `contain()` does
a trie walk; `iterate()` does a depth-first traversal; a `word_count: usize`
counter replaces `HashSet::len()`. Construction is ~35% faster.
- **`TrieCharLegacy`**: the original `TrieChar` (with `HashSet<String>`) is
preserved as `TrieCharLegacy` for comparison and for workloads that call
`contain()` on a hot path. It implements `DictBackend` and can be used as
`NewmmTokenizer<TrieCharLegacy>`.

### Changed

Expand Down
1,129 changes: 939 additions & 190 deletions benches/tokenizer.rs

Large diffs are not rendered by default.

Loading