Python - Restore methods on Encoding

This commit is contained in:
Anthony MOI
2019-12-29 01:26:42 -05:00
parent 708a63514a
commit 049029dc42

View File

@ -16,15 +16,15 @@ impl Encoding {
#[pymethods]
impl Encoding {
// #[getter]
// fn get_original(&self) -> String {
// self.encoding.get_original().to_owned()
// }
#[getter]
fn get_original(&self) -> String {
self.encoding.get_normalized().get_original().to_owned()
}
// #[getter]
// fn get_normalized(&self) -> String {
// self.encoding.get_normalized().to_owned()
// }
#[getter]
fn get_normalized(&self) -> String {
self.encoding.get_normalized().get().to_owned()
}
#[getter]
fn get_ids(&self) -> Vec<u32> {
@ -41,10 +41,10 @@ impl Encoding {
self.encoding.get_type_ids().to_vec()
}
// #[getter]
// fn get_offsets(&self) -> Vec<(usize, usize)> {
// self.encoding.get_offsets().to_vec()
// }
#[getter]
fn get_offsets(&self) -> Vec<(usize, usize)> {
self.encoding.get_offsets().to_vec()
}
#[getter]
fn get_special_tokens_mask(&self) -> Vec<u32> {