pub struct LatticeGuard<'a, 'l, 's> { /* private fields */ }Expand description
A guard for a lattice that holds a reference to the sentence string.
It is returned by Lattice::set_sentence().
Implementations§
Source§impl<'a, 'l> LatticeGuard<'a, 'l, '_>
impl<'a, 'l> LatticeGuard<'a, 'l, '_>
Sourcepub fn into_inner(self) -> &'l mut Lattice<'a>
pub fn into_inner(self) -> &'l mut Lattice<'a>
Returns the underlying Lattice.
Source§impl LatticeGuard<'_, '_, '_>
impl LatticeGuard<'_, '_, '_>
Sourcepub fn to_str(&mut self) -> &str
pub fn to_str(&mut self) -> &str
Returns the analysis result as a string.
It wraps mecab_lattice_tostr(), the wrapper of MeCab::Lattice::toString().
Sourcepub fn bos_node(&self) -> NodeCursor<'_> ⓘ
pub fn bos_node(&self) -> NodeCursor<'_> ⓘ
Returns a cursor to the BoS node.
It wraps mecab_lattice_get_bos_node(), the wrapper of MeCab::Lattice::bos_node().
Sourcepub fn eos_node(&self) -> NodeCursor<'_> ⓘ
pub fn eos_node(&self) -> NodeCursor<'_> ⓘ
Returns a cursor to the EoS node.
It wraps mecab_lattice_get_eos_node(), the wrapper of MeCab::Lattice::eos_node().
Source§impl<'s> LatticeGuard<'_, '_, 's>
impl<'s> LatticeGuard<'_, '_, 's>
Sourcepub fn sentence(&self) -> &str
pub fn sentence(&self) -> &str
Returns the sentence string.
It wraps mecab_lattice_get_sentence(), the wrapper of MeCab::Lattice::sentence().
The returned value should be equal to the input sentence of Lattice::set_sentence().
Sourcepub fn sentence_len(&self) -> usize
pub fn sentence_len(&self) -> usize
Returns the length of the sentence.
It wraps mecab_lattice_get_size(), the wrapper of MeCab::Lattice::size().