pub struct WordId { /* private fields */ }Expand description
Dictionary word ID
Encode dictionary ID and word internal ID as 4 bits and 28 bits respectively DicId 0 - system dictionary DicId 15 - OOV and other special nodes
Implementations§
Source§impl WordId
impl WordId
pub const INVALID: WordId
pub const BOS: WordId
pub const EOS: WordId
pub const MAX_WORD: u32 = 268_435_455u32
Sourcepub fn checked(dic: u8, word: u32) -> SudachiResult<WordId>
pub fn checked(dic: u8, word: u32) -> SudachiResult<WordId>
Creates the WordId with correctness checking
pub fn as_raw(&self) -> u32
Sourcepub fn is_oov(&self) -> bool
pub fn is_oov(&self) -> bool
Check if the word is OOV An OOV node can come of OOV handlers or be a special system node like BOS or EOS
Sourcepub fn is_special(&self) -> bool
pub fn is_special(&self) -> bool
Checks if the WordId corresponds to a special node
Trait Implementations§
Source§impl Ord for WordId
impl Ord for WordId
Source§impl PartialOrd for WordId
impl PartialOrd for WordId
impl Copy for WordId
impl Eq for WordId
impl StructuralPartialEq for WordId
Auto Trait Implementations§
impl Freeze for WordId
impl RefUnwindSafe for WordId
impl Send for WordId
impl Sync for WordId
impl Unpin for WordId
impl UnwindSafe for WordId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more