pub struct Node<'a> { /* private fields */ }Expand description
A single node (morpheme) in the MeCab lattice. It wraps C mecab_node_t.
The lifetime parameter is bound to
Lattice and the input sentence.
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Sourcepub fn as_ptr(&self) -> *mut mecab_node_t
pub fn as_ptr(&self) -> *mut mecab_node_t
Returns the raw pointer to the underlying mecab_node_t.
Sourcepub fn next(self) -> Option<Self>
pub fn next(self) -> Option<Self>
Returns the next node in the same lattice.
It wraps mecab_node_t::next.
None is likely to imply that self is EoS.
Sourcepub fn prev(self) -> Option<Self>
pub fn prev(self) -> Option<Self>
Returns the previous node in the same lattice.
It wraps mecab_node_t::prev.
None is likely to imply that self is BoS.
Sourcepub fn feature(self) -> &'a str
pub fn feature(self) -> &'a str
Returns the feature string of this node.
It wraps mecab_node_t::feature.
Sourcepub fn surface(self) -> &'a str
pub fn surface(self) -> &'a str
Returns the surface string of this node.
It wraps mecab_node_t::surface and mecab_node_t::length.
Sourcepub fn is_best(self) -> bool
pub fn is_best(self) -> bool
Returns true if this node is part of the best path.
It wraps mecab_node_t::isbest.
Sourcepub fn alpha(self) -> f32
pub fn alpha(self) -> f32
Returns the forward accumulative log summation.
It wraps mecab_node_t::alpha.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> RefUnwindSafe for Node<'a>
impl<'a> !Send for Node<'a>
impl<'a> !Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnsafeUnpin for Node<'a>
impl<'a> UnwindSafe for Node<'a>
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