Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update bucket_added_vocabulary.rs
Co-authored-by: Simon Brandeis <33657802+SBrandeis@users.noreply.github.com>
  • Loading branch information
0z5a and SBrandeis authored Nov 10, 2026
commit 7aa579a8ac198b03e1b75953f25e416d2de9eee0
3 changes: 0 additions & 3 deletions tokenizers/tk-encode/src/vocab/bucket_added_vocabulary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ fn is_single_word(bytes: &[u8], match_start: usize, match_end: usize) -> bool {
// FIXME: we use chr conversion for now, this can be inproved by using bitmap.
// This is the equivalent of `\w`, so its letters, numbers and underscore
let s = unsafe { std::str::from_utf8_unchecked(bytes) };
// The char before the match is looked up in the whole text, not just from where the scan
// resumed: the scan can resume inside a word (after a rejected candidate) or right after an
// earlier added token, and neither is a word boundary.
let before_ok = s[..match_start]
.chars()
.next_back()
Expand Down