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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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