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 da65c81950df6bbe57f8501aa7c7707a0283a702
4 changes: 1 addition & 3 deletions tokenizers/tk-encode/src/vocab/bucket_added_vocabulary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,17 +893,15 @@ mod tests {
)
.unwrap();

// The first `ü` is rejected, and the scan resumes inside its two UTF-8 bytes.
assert_eq!(
segments(&vocab, "üü ü", false, false),
vec![(Some("üü ".to_string()), None), (None, Some(0))]
);
// `zz` at 0..2 is rejected; `zz` at 1..3 still follows a `z`.
assert_eq!(
segments(&vocab, "zzz zz", false, false),
vec![(Some("zzz ".to_string()), None), (None, Some(1))]
);
// `foo` follows the added token `x`, whose last char is a word char.
// `x` has `single_word=false` so it matches even inside a word
assert_eq!(
segments(&vocab, "xfoo", false, false),
vec![(None, Some(3)), (Some("foo".to_string()), None)]
Expand Down