use crate::common::{Punctuation, Stopwords, Text, WindowSize};
type Threshold = f32;
type Ngram = usize;
pub enum YakeParams<'a> {
WithDefaults(Text<'a>, Stopwords<'a>),
All(
Text<'a>,
Stopwords<'a>,
Punctuation<'a>,
Threshold,
Ngram,
WindowSize,
),
}
impl<'a> YakeParams<'a> {
pub fn get_params(
&self,
) -> (
Text<'a>,
Stopwords<'a>,
Punctuation<'a>,
Threshold,
Ngram,
WindowSize,
) {
match self {
YakeParams::WithDefaults(text, stop_words) => (*text, *stop_words, None, 0.85, 3, 2),
YakeParams::All(text, stop_words, punctuation, threshold, ngram, window_size) => (
*text,
*stop_words,
*punctuation,
*threshold,
*ngram,
*window_size,
),
}
}
}