pub struct DetectorConfig<H: BuildHasher + Default> {
pub languages: HashSet<ScriptLanguage, H>,
/* private fields */
}Fields§
§languages: HashSet<ScriptLanguage, H>Implementations§
Source§impl DetectorConfig<RandomState>
impl DetectorConfig<RandomState>
pub fn new() -> Self
Sourcepub fn new_max_trigrams() -> Self
pub fn new_max_trigrams() -> Self
Faster, but lower accuracy
pub fn new_all_languages() -> Self
Source§impl<H: BuildHasher + Default> DetectorConfig<H>
impl<H: BuildHasher + Default> DetectorConfig<H>
pub fn with_languages(languages: HashSet<ScriptLanguage, H>) -> Self
Sourcepub fn max_trigrams(self) -> Self
pub fn max_trigrams(self) -> Self
Faster, but lower accuracy
pub fn languages<H2: BuildHasher + Default>( self, languages: HashSet<ScriptLanguage, H2>, ) -> DetectorConfig<H2>
pub fn copy_with_languages<H2: BuildHasher + Default>( &self, languages: HashSet<ScriptLanguage, H2>, ) -> DetectorConfig<H2>
pub fn all_languages(self) -> DetectorConfig<RandomState>
pub fn long_ngrams(self, long_text_ngrams: RangeInclusive<usize>) -> Self
pub fn short_ngrams(self, short_text_ngrams: RangeInclusive<usize>) -> Self
pub fn minlen(self, long_text_minlen: usize) -> Self
Trait Implementations§
Source§impl<H: Debug + BuildHasher + Default> Debug for DetectorConfig<H>
impl<H: Debug + BuildHasher + Default> Debug for DetectorConfig<H>
Source§impl<H: BuildHasher + Default> Default for DetectorConfig<H>
impl<H: BuildHasher + Default> Default for DetectorConfig<H>
Auto Trait Implementations§
impl<H> Freeze for DetectorConfig<H>where
H: Freeze,
impl<H> RefUnwindSafe for DetectorConfig<H>where
H: RefUnwindSafe,
impl<H> Send for DetectorConfig<H>where
H: Send,
impl<H> Sync for DetectorConfig<H>where
H: Sync,
impl<H> Unpin for DetectorConfig<H>where
H: Unpin,
impl<H> UnwindSafe for DetectorConfig<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more