sudachi::analysis::node

Struct ResultNode

source
pub struct ResultNode { /* private fields */ }
Expand description

Full lattice node, as the result of analysis. All indices (including inner) are in the modified sentence space Indices are converted to original sentence space when user request them.

Implementations§

source§

impl ResultNode

source

pub fn new( inner: Node, total_cost: i32, begin_bytes: u16, end_bytes: u16, word_info: WordInfo, ) -> ResultNode

source§

impl ResultNode

source

pub fn word_info(&self) -> &WordInfo

source

pub fn begin_bytes(&self) -> usize

Returns begin offset in bytes of node surface in a sentence

source

pub fn end_bytes(&self) -> usize

Returns end offset in bytes of node surface in a sentence

source

pub fn bytes_range(&self) -> Range<usize>

Returns range in bytes (for easy string slicing)

source

pub fn set_bytes_range(&mut self, begin: u16, end: u16)

source

pub fn set_char_range(&mut self, begin: u16, end: u16)

source

pub fn num_splits(&self, mode: Mode) -> usize

Returns number of splits in a specified mode

source

pub fn split<'a>( &'a self, mode: Mode, lexicon: &'a LexiconSet<'a>, subset: InfoSubset, text: &'a InputBuffer, ) -> NodeSplitIterator<'a>

Split the node with a specified mode using the dictionary data

Trait Implementations§

source§

impl Clone for ResultNode

source§

fn clone(&self) -> ResultNode

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Display for ResultNode

source§

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

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

impl LatticeNode for ResultNode

source§

fn begin(&self) -> usize

source§

fn end(&self) -> usize

source§

fn cost(&self) -> i16

source§

fn word_id(&self) -> WordId

source§

fn left_id(&self) -> u16

source§

fn is_oov(&self) -> bool

Is true when the word does not come from the dictionary. BOS and EOS are also treated as OOV.
source§

fn is_special_node(&self) -> bool

If a node is a special system node like BOS or EOS. Java name isSystem (which is similar to a regular node coming from the system dictionary)
source§

fn num_codepts(&self) -> usize

Returns number of codepoints in the current node
source§

fn char_range(&self) -> Range<usize>

Utility method for extracting [begin, end) codepoint range.
source§

impl PathCost for ResultNode

source§

impl RightId for ResultNode

source§

fn right_id(&self) -> u16

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.