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
impl ResultNode
source§impl ResultNode
impl ResultNode
pub fn word_info(&self) -> &WordInfo
sourcepub fn begin_bytes(&self) -> usize
pub fn begin_bytes(&self) -> usize
Returns begin offset in bytes of node surface in a sentence
sourcepub fn bytes_range(&self) -> Range<usize>
pub fn bytes_range(&self) -> Range<usize>
Returns range in bytes (for easy string slicing)
pub fn set_bytes_range(&mut self, begin: u16, end: u16)
pub fn set_char_range(&mut self, begin: u16, end: u16)
sourcepub fn num_splits(&self, mode: Mode) -> usize
pub fn num_splits(&self, mode: Mode) -> usize
Returns number of splits in a specified mode
sourcepub fn split<'a>(
&'a self,
mode: Mode,
lexicon: &'a LexiconSet<'a>,
subset: InfoSubset,
text: &'a InputBuffer,
) -> NodeSplitIterator<'a> ⓘ
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
impl Clone for ResultNode
source§fn clone(&self) -> ResultNode
fn clone(&self) -> ResultNode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Display for ResultNode
impl Display for ResultNode
source§impl LatticeNode for ResultNode
impl LatticeNode for ResultNode
fn begin(&self) -> usize
fn end(&self) -> usize
fn cost(&self) -> i16
fn word_id(&self) -> WordId
fn left_id(&self) -> u16
source§fn is_oov(&self) -> bool
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
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
fn num_codepts(&self) -> usize
Returns number of codepoints in the current node
source§fn char_range(&self) -> Range<usize>
fn char_range(&self) -> Range<usize>
Utility method for extracting [begin, end) codepoint range.
source§impl PathCost for ResultNode
impl PathCost for ResultNode
fn total_cost(&self) -> i32
fn is_connected_to_bos(&self) -> bool
Auto Trait Implementations§
impl Freeze for ResultNode
impl RefUnwindSafe for ResultNode
impl Send for ResultNode
impl Sync for ResultNode
impl Unpin for ResultNode
impl UnwindSafe for ResultNode
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
)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