Struct lib_word_count::word_index::IndexedWord [-] [+] [src]

pub struct IndexedWord {
    pub word: String,
    pub appeared: i64,
}

A counted word.

This struct contains members for storing a word and the number of times it appeared. This struct is intended for use with add_word.

Examples

use lib_word_count::word_index;

let indexed_word = word_index::IndexedWord{
    word: "Text".to_string(),
    appeared: 12
};

assert_eq!(indexed_word.word, "Text".to_string());
assert_eq!(indexed_word.appeared, 12i64);

Fields

word

The word that's indexed.

appeared

The amount of times this word appeared.

Trait Implementations

impl Sortable for IndexedWord

Words are sorted by the amount of times they appeared.

fn weight(&self) -> i64

Derived Implementations

impl PartialEq for IndexedWord

fn eq(&self, __arg_0: &IndexedWord) -> bool

fn ne(&self, __arg_0: &IndexedWord) -> bool

impl Debug for IndexedWord

fn fmt(&self, __arg_0: &mut Formatter) -> Result