pub trait TFIDFEngine<N>: Send + Sync{
// Required methods
fn tf_vec(
freq: &TermFrequency,
term_dim_sample: &IndexSet<Box<str>>,
) -> TFVector<N>;
fn tf_denorm(val: N) -> u32;
// Provided method
fn idf_vec(corpus: &Corpus, term_dim_sample: &Vec<Box<str>>) -> Vec<f32> { ... }
}Expand description
TF-IDF Calculation Engine Trait
Defines the behavior of a TF-IDF calculation engine.
Custom engines can be implemented and plugged into
[TFIDFVectorizer].
A default implementation, DefaultTFIDFEngine, is provided.
§Supported Numeric Types
f16f32u16u32
Required Methods§
fn tf_denorm(val: N) -> u32
Provided Methods§
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.