mirror of
https://github.com/mii443/tokenizers.git
synced 2025-12-18 06:19:14 +00:00
Python - Improve pre-tokenizers docs
This commit is contained in:
@@ -58,7 +58,7 @@ class TestMetaspace:
|
||||
def test_instantiate(self):
|
||||
assert Metaspace() is not None
|
||||
assert Metaspace(replacement="-") is not None
|
||||
with pytest.raises(Exception, match="replacement must be a character"):
|
||||
with pytest.raises(ValueError, match="expected a string of length 1"):
|
||||
Metaspace(replacement="")
|
||||
assert Metaspace(add_prefix_space=True) is not None
|
||||
assert isinstance(Metaspace(), PreTokenizer)
|
||||
@@ -69,7 +69,7 @@ class TestMetaspace:
|
||||
class TestCharDelimiterSplit:
|
||||
def test_instantiate(self):
|
||||
assert CharDelimiterSplit("-") is not None
|
||||
with pytest.raises(Exception, match="delimiter must be a single character"):
|
||||
with pytest.raises(ValueError, match="expected a string of length 1"):
|
||||
CharDelimiterSplit("")
|
||||
assert isinstance(CharDelimiterSplit(" "), PreTokenizer)
|
||||
assert isinstance(CharDelimiterSplit(" "), CharDelimiterSplit)
|
||||
|
||||
Reference in New Issue
Block a user