Struct lindera_tokenizer::token::Token
source · pub struct Token<'a> {
pub text: &'a str,
pub byte_start: usize,
pub byte_end: usize,
pub position: usize,
pub position_length: usize,
pub word_id: WordId,
pub dictionary: &'a Dictionary,
pub user_dictionary: Option<&'a UserDictionary>,
/* private fields */
}
Fields§
§text: &'a str
Text content of the token.
byte_start: usize
Starting position of the token in bytes.
byte_end: usize
Ending position of the token in bytes.
position: usize
Position, expressed in number of tokens.
position_length: usize
The length expressed in terms of number of original tokens.
word_id: WordId
The ID of the word and a flag to indicate whether the word is registered in the dictionary.
dictionary: &'a Dictionary
Reference of dictionary.
user_dictionary: Option<&'a UserDictionary>
Reference of user dictionary.
Implementations§
source§impl<'a> Token<'a>
impl<'a> Token<'a>
pub fn new( text: &'a str, start: usize, end: usize, position: usize, word_id: WordId, dictionary: &'a Dictionary, user_dictionary: Option<&'a UserDictionary> ) -> Self
pub fn get_details(&mut self) -> Option<Vec<&str>>
pub fn set_details(&mut self, details: Option<Vec<String>>) -> &Token<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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