Enum imdb_index::NameScorer [−][src]
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]
impl NameScorer
pub fn possible_names() -> &'static [&'static str]
[src]
pub fn possible_names() -> &'static [&'static str]
Returns a list of strings representing the possible scorer values.
pub fn as_str(&self) -> &'static str
[src]
pub fn as_str(&self) -> &'static str
Return a string representation of this scorer.
The string returned can be parsed back into a NameScorer
.
Trait Implementations
impl Clone for NameScorer
[src]
impl Clone for NameScorer
fn clone(&self) -> NameScorer
[src]
fn clone(&self) -> NameScorer
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for NameScorer
[src]
impl Copy for NameScorer
impl Debug for NameScorer
[src]
impl Debug for NameScorer
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for NameScorer
[src]
impl Eq for NameScorer
impl Hash for NameScorer
[src]
impl Hash for NameScorer
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for NameScorer
[src]
impl PartialEq for NameScorer
fn eq(&self, other: &NameScorer) -> bool
[src]
fn eq(&self, other: &NameScorer) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Default for NameScorer
[src]
impl Default for NameScorer
fn default() -> NameScorer
[src]
fn default() -> NameScorer
Returns the "default value" for a type. Read more
impl Display for NameScorer
[src]
impl Display for NameScorer
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromStr for NameScorer
[src]
impl FromStr for NameScorer
Auto Trait Implementations
impl Send for NameScorer
impl Send for NameScorer
impl Sync for NameScorer
impl Sync for NameScorer