pub struct Token {Show 16 fields
pub form: String,
pub tag: String,
pub position: usize,
pub length: usize,
pub word_position: usize,
pub sent_position: usize,
pub line_number: usize,
pub sub_sent_position: usize,
pub score: f32,
pub typo_cost: f32,
pub typo_form_id: u32,
pub paired_token: Option<usize>,
pub morpheme_id: Option<u32>,
pub tag_id: Option<u8>,
pub sense_or_script: Option<u8>,
pub dialect: Option<u16>,
}Expand description
A single morpheme token produced by Kiwi analysis.
Fields§
§form: StringSurface form.
tag: StringPart-of-speech tag string.
position: usizeCharacter-based start offset in the original UTF-8 text (str.chars()).
length: usizeCharacter length (str.chars() count), not byte length.
word_position: usizeWord index inside the analyzed sentence.
sent_position: usizeSentence index in multi-sentence analysis output.
line_number: usizeLine number metadata from Kiwi output.
sub_sent_position: usizeSub-sentence index metadata from Kiwi output.
score: f32Token score from language model.
typo_cost: f32Typo correction cost for this token.
typo_form_id: u32Typo form identifier from Kiwi internals.
paired_token: Option<usize>Optional paired-token index (for paired punctuation etc.).
morpheme_id: Option<u32>Optional morpheme id for dictionary-backed APIs.
tag_id: Option<u8>Optional numeric tag id.
sense_or_script: Option<u8>Optional sense id or script id depending on tag.
dialect: Option<u16>Optional dialect id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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