pub struct DetectorBuilder<'m, H: BuildHasher> { /* private fields */ }Implementations§
Source§impl<'m> DetectorBuilder<'m, DummyBuildHasher>
impl<'m> DetectorBuilder<'m, DummyBuildHasher>
Sourcepub fn new(models_storage: &'m ModelsStorage) -> Self
pub fn new(models_storage: &'m ModelsStorage) -> Self
Will have all languages, all ngrams enabled if none selected
Sourcepub fn build(self) -> Detector<'m, RandomState>
pub fn build(self) -> Detector<'m, RandomState>
Build with all languages
Source§impl<'m, H: BuildHasher> DetectorBuilder<'m, H>
impl<'m, H: BuildHasher> DetectorBuilder<'m, H>
Sourcepub fn languages<H2: RealHasher>(
self,
languages: HashSet<ScriptLanguage, H2>,
) -> DetectorBuilder<'m, H2>
pub fn languages<H2: RealHasher>( self, languages: HashSet<ScriptLanguage, H2>, ) -> DetectorBuilder<'m, H2>
Change languages
Sourcepub fn minlen(self, long_text_minlen: usize) -> Self
pub fn minlen(self, long_text_minlen: usize) -> Self
Min text length (in chars, excluding word separators) for switching from short ngrams to long ngrams
Sourcepub fn long_ngrams(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
pub fn long_ngrams(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
Select ngrams for text length >= minlen (in chars, excluding word separators)
Sourcepub fn short_ngrams(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
pub fn short_ngrams(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
Select ngrams for text length < minlen (in chars, excluding word separators)
Sourcepub fn long_ngrams_add(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
pub fn long_ngrams_add(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
Add long text ngrams. Starts with empty ngrams
Sourcepub fn short_ngrams_add(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
pub fn short_ngrams_add(self, ngrams: impl Iterator<Item = NgramSize>) -> Self
Add short text ngrams. Starts with empty ngrams
Sourcepub fn max_trigrams(self) -> Self
pub fn max_trigrams(self) -> Self
Faster, but lower accuracy
Trait Implementations§
Source§impl<'m, H: Clone + BuildHasher> Clone for DetectorBuilder<'m, H>
impl<'m, H: Clone + BuildHasher> Clone for DetectorBuilder<'m, H>
Source§fn clone(&self) -> DetectorBuilder<'m, H>
fn clone(&self) -> DetectorBuilder<'m, H>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'m, H> Freeze for DetectorBuilder<'m, H>where
H: Freeze,
impl<'m, H> !RefUnwindSafe for DetectorBuilder<'m, H>
impl<'m, H> Send for DetectorBuilder<'m, H>where
H: Send,
impl<'m, H> Sync for DetectorBuilder<'m, H>where
H: Sync,
impl<'m, H> Unpin for DetectorBuilder<'m, H>where
H: Unpin,
impl<'m, H> !UnwindSafe for DetectorBuilder<'m, H>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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