Trait WordProbabilities

Source
pub trait WordProbabilities {
    // Required methods
    fn probability(&self, word: &str) -> Float;
    fn n_words(&self) -> usize;
    fn entries(&self) -> Box<dyn Iterator<Item = (String, Float)> + '_>;
}
Expand description

Word probabilities.

Required Methods§

Source

fn probability(&self, word: &str) -> Float

Returns the probability of a word.

Source

fn n_words(&self) -> usize

Returns the number of words in the vocabulary.

Source

fn entries(&self) -> Box<dyn Iterator<Item = (String, Float)> + '_>

Returns an iterator over words and probabilities in the vocabulary.

Implementations on Foreign Types§

Source§

impl WordProbabilities for WordFreq

Source§

fn probability(&self, word: &str) -> Float

Source§

fn n_words(&self) -> usize

Source§

fn entries(&self) -> Box<dyn Iterator<Item = (String, Float)> + '_>

Implementors§