[][src]Enum imdb_index::NameScorer

pub enum NameScorer {
    OkapiBM25,
    TFIDF,
    Jaccard,
    QueryRatio,
}

The type of scorer that the name index should use.

The default is OkapiBM25. If you aren't sure which scorer to use, then stick with the default.

Variants

OkapiBM25

OkapiBM25 is a TF-IDF-like ranking function, which takes name length into account.

TFIDF

TFIDF is the traditional TF-IDF ranking function, which does not incorporate document length.

Jaccard

Jaccard is a ranking function determined by computing the similarity of ngrams between the query and a name in the index. The similarity is computed by dividing the number of ngrams in common by the total number of distinct ngrams in both the query and the name combined.

QueryRatio

QueryRatio is a ranking function that represents the ratio of query terms that matched a name. It is computed by dividing the number of ngrams in common by the total number of ngrams in the query only.

Methods

impl NameScorer[src]

pub fn possible_names() -> &'static [&'static str][src]

Returns a list of strings representing the possible scorer values.

pub fn as_str(&self) -> &'static str[src]

Return a string representation of this scorer.

The string returned can be parsed back into a NameScorer.

Trait Implementations

impl PartialEq<NameScorer> for NameScorer[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Copy for NameScorer[src]

impl Eq for NameScorer[src]

impl Default for NameScorer[src]

impl Clone for NameScorer[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Hash for NameScorer[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for NameScorer[src]

impl Display for NameScorer[src]

impl FromStr for NameScorer[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]