From d3c3f5a7005997277896acd3ef89b3dba5d37979 Mon Sep 17 00:00:00 2001 From: Anthony MOI Date: Thu, 2 Jan 2020 18:06:06 -0500 Subject: [PATCH] Python - Expose ByteLevel alphabet --- bindings/python/src/pre_tokenizers.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bindings/python/src/pre_tokenizers.rs b/bindings/python/src/pre_tokenizers.rs index e1c18b7b..08127219 100644 --- a/bindings/python/src/pre_tokenizers.rs +++ b/bindings/python/src/pre_tokenizers.rs @@ -50,6 +50,14 @@ impl ByteLevel { ))), }) } + + #[staticmethod] + fn alphabet() -> Vec { + tk::pre_tokenizers::byte_level::ByteLevel::alphabet() + .into_iter() + .map(|c| c.to_string()) + .collect() + } } #[pyclass]