Trait ProcessedDocument

Source
pub trait ProcessedDocument: Document {
    // Required methods
    fn term_frequency<K>(&self, term: K) -> usize
       where K: Borrow<Self::Term>;
    fn max(&self) -> Option<&Self::Term>;
}
Expand description

A document where the frequencies of each term is already calculated.

Required Methods§

Source

fn term_frequency<K>(&self, term: K) -> usize
where K: Borrow<Self::Term>,

Returns the number of times a (non-normalized) term exists within the document.

Source

fn max(&self) -> Option<&Self::Term>

Returns the term with the highest frequency, or tied for the highest frequency.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ProcessedDocument for BTreeMap<T, usize>
where T: Ord,

Source§

fn term_frequency<K>(&self, term: K) -> usize
where K: Borrow<Self::Term>,

Source§

fn max(&self) -> Option<&Self::Term>

Source§

impl<T> ProcessedDocument for Vec<(T, usize)>
where T: PartialEq,

Source§

fn term_frequency<K>(&self, term: K) -> usize
where K: Borrow<T>,

Source§

fn max(&self) -> Option<&T>

Source§

impl<T> ProcessedDocument for HashMap<T, usize>
where T: Eq + Hash,

Source§

fn term_frequency<K>(&self, term: K) -> usize
where K: Borrow<Self::Term>,

Source§

fn max(&self) -> Option<&Self::Term>

Implementors§