Skip to main content

MorphemeRef

Enum MorphemeRef 

Source
#[non_exhaustive]
pub enum MorphemeRef<'a, D> { ListItem(Morpheme<'a, D>), Single(Box<SingleMorpheme<D>>), }
Expand description

A morpheme reference that can be either list-backed or standalone.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ListItem(Morpheme<'a, D>)

§

Single(Box<SingleMorpheme<D>>)

Implementations§

Source§

impl<D: DictionaryAccess + Clone> MorphemeRef<'_, D>

Source

pub fn user_data(&self) -> &str

Returns user-defined data associated with this morpheme.

Trait Implementations§

Source§

impl<D: Clone> Clone for MorphemeRef<'_, D>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D: DictionaryAccess + Clone> Debug for MorphemeRef<'_, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: DictionaryAccess + Clone> MorphemeView for MorphemeRef<'_, D>

Source§

type Dictionary = D

Source§

fn begin(&self) -> usize

Returns the begin index in bytes of the morpheme.
Source§

fn end(&self) -> usize

Returns the end index in bytes of the morpheme.
Source§

fn begin_c(&self) -> usize

Returns the codepoint offset of the morpheme begin.
Source§

fn end_c(&self) -> usize

Returns the codepoint offset of the morpheme end.
Source§

fn surface(&self) -> MorphemeSurface<'_>

Returns text corresponding to the morpheme.
Source§

fn word_id(&self) -> WordId

Returns the word id of morpheme.
Source§

fn get_word_info(&self) -> &WordInfo

Returns the dictionary information for this morpheme.
Source§

fn self_morpheme(&self) -> MorphemeRef<'_, D>

Source§

fn part_of_speech_id(&self) -> u16

Returns the ID of part of speech of the morpheme.
Source§

fn resolver<'a>(&'a self) -> &'a dyn WordInfoResolver
where Self::Dictionary: 'a,

Source§

fn part_of_speech<'a>(&'a self) -> &'a [String]
where Self::Dictionary: 'a,

Returns the part of speech.
Source§

fn dictionary_form<'a>(&'a self) -> &'a str
where Self::Dictionary: 'a,

Returns the dictionary form of morpheme. Read more
Source§

fn dictionary_form_morpheme( &self, ) -> SudachiResult<MorphemeRef<'_, Self::Dictionary>>
where Self::Dictionary: Clone,

Returns the morpheme corresponding to this morpheme’s dictionary form. Read more
Source§

fn normalized_form<'a>(&'a self) -> &'a str
where Self::Dictionary: 'a,

Returns the normalized form of morpheme. Read more
Source§

fn normalized_form_morpheme( &self, ) -> SudachiResult<MorphemeRef<'_, Self::Dictionary>>
where Self::Dictionary: Clone,

Returns the morpheme corresponding to this morpheme’s normalized form. Read more
Source§

fn reading_form<'a>(&'a self) -> &'a str
where Self::Dictionary: 'a,

Returns the reading form of morpheme. Read more
Source§

fn is_oov(&self) -> bool

Returns if this morpheme is out of vocabulary.
Source§

fn dictionary_id(&self) -> i32

Returns the dictionary id where the morpheme belongs. Read more
Source§

fn synonym_group_ids(&self) -> &[i32]

Source§

fn user_data(&self) -> &str

Returns user-defined data associated with this morpheme.

Auto Trait Implementations§

§

impl<'a, D> !RefUnwindSafe for MorphemeRef<'a, D>

§

impl<'a, D> !Send for MorphemeRef<'a, D>

§

impl<'a, D> !Sync for MorphemeRef<'a, D>

§

impl<'a, D> !UnwindSafe for MorphemeRef<'a, D>

§

impl<'a, D> Freeze for MorphemeRef<'a, D>

§

impl<'a, D> Unpin for MorphemeRef<'a, D>

§

impl<'a, D> UnsafeUnpin for MorphemeRef<'a, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.