Update Python bindings with new interface

This commit is contained in:
Anthony MOI
2020-07-29 16:45:55 -04:00
committed by Anthony MOI
parent 261a0c6dd8
commit 7833965dc4
8 changed files with 101 additions and 243 deletions

View File

@ -75,11 +75,7 @@ impl Encoding {
#[args(growing_offsets = true)]
fn merge(encodings: Vec<PyRef<Encoding>>, growing_offsets: bool) -> Encoding {
tk::tokenizer::Encoding::merge(
encodings
.into_iter()
.map(|e| e.encoding.clone())
.collect::<Vec<_>>()
.as_slice(),
encodings.into_iter().map(|e| e.encoding.clone()),
growing_offsets,
)
.into()