sudachi::analysis::node

Trait LatticeNode

source
pub trait LatticeNode: RightId {
    // Required methods
    fn begin(&self) -> usize;
    fn end(&self) -> usize;
    fn cost(&self) -> i16;
    fn word_id(&self) -> WordId;
    fn left_id(&self) -> u16;

    // Provided methods
    fn is_oov(&self) -> bool { ... }
    fn is_special_node(&self) -> bool { ... }
    fn num_codepts(&self) -> usize { ... }
    fn char_range(&self) -> Range<usize> { ... }
}

Required Methods§

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

Provided Methods§

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.

Implementors§