pub struct CharTokenizer { /* private fields */ }Trait Implementations§
Source§impl Default for CharTokenizer
impl Default for CharTokenizer
Source§impl Tokenizer for CharTokenizer
impl Tokenizer for CharTokenizer
Source§fn train(
&mut self,
corpus: &mut dyn CorpusSource,
config: &TrainingConfig,
) -> Result<Vocabulary>
fn train( &mut self, corpus: &mut dyn CorpusSource, config: &TrainingConfig, ) -> Result<Vocabulary>
Learn a vocabulary from
corpus, install it, and return a copy.Source§fn load(&mut self, vocabulary: Vocabulary) -> Result<()>
fn load(&mut self, vocabulary: Vocabulary) -> Result<()>
Install a vocabulary produced earlier. Implementations validate it.
fn encode(&self, input: &CanonicalInput) -> Result<TokenSequence>
fn decode(&self, tokens: &TokenSequence) -> Result<CanonicalInput>
fn vocabulary(&self) -> Option<&Vocabulary>
fn capabilities(&self) -> TokenizerCapabilities
Source§fn encode_open(
&self,
input: &CanonicalInput,
policy: UnknownPolicy,
) -> Result<TokenSequence, KuteError>
fn encode_open( &self, input: &CanonicalInput, policy: UnknownPolicy, ) -> Result<TokenSequence, KuteError>
Encode under an explicit policy for symbols the vocabulary lacks. Read more
Auto Trait Implementations§
impl Forget for CharTokenizer
impl Freeze for CharTokenizer
impl Move for CharTokenizer
impl RefUnwindSafe for CharTokenizer
impl Send for CharTokenizer
impl Sync for CharTokenizer
impl Unpin for CharTokenizer
impl UnsafeUnpin for CharTokenizer
impl UnwindSafe for CharTokenizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more