[−][src]Struct lingua::LanguageDetectorBuilder
This struct configures and creates an instance of
LanguageDetector
.
Implementations
impl LanguageDetectorBuilder
[src]
pub fn from_all_languages() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages.
pub fn from_all_spoken_languages() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in spoken languages.
pub fn from_all_languages_with_arabic_script() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages supporting the Arabic script.
pub fn from_all_languages_with_cyrillic_script() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages supporting the Cyrillic script.
pub fn from_all_languages_with_devanagari_script() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages supporting the Devanagari script.
pub fn from_all_languages_with_latin_script() -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages supporting the Latin script.
pub fn from_all_languages_without(languages: &[Language]) -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with all built-in languages except those specified in languages
.
⚠ Panics if less than two languages
are specified.
pub fn from_languages(languages: &[Language]) -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with the specified languages
.
⚠ Panics if less than two languages
are specified.
pub fn from_iso_codes_639_1(iso_codes: &[IsoCode639_1]) -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with the languages specified by the respective ISO 639-1 codes.
⚠ Panics if less than two iso_codes
are specified.
pub fn from_iso_codes_639_3(iso_codes: &[IsoCode639_3]) -> Self
[src]
Creates and returns an instance of LanguageDetectorBuilder
with the languages specified by the respective ISO 639-3 codes.
⚠ Panics if less than two iso_codes
are specified.
pub fn with_minimum_relative_distance(&mut self, distance: f64) -> &mut Self
[src]
Sets the desired value for the minimum relative distance measure.
By default, Lingua returns the most likely language for a given input text. However, there are certain words that are spelled the same in more than one language. The word prologue, for instance, is both a valid English and French word. Lingua would output either English or French which might be wrong in the given context. For cases like that, it is possible to specify a minimum relative distance that the logarithmized and summed up probabilities for each possible language have to satisfy.
Be aware that the distance between the language probabilities is
dependent on the length of the input text. The longer the input
text, the larger the distance between the languages. So if you
want to classify very short text phrases, do not set the minimum
relative distance too high. Otherwise you will get most results
returned as None
which is the return value for cases
where language detection is not reliably possible.
⚠ Panics if distance
is smaller than 0.0 or greater than 0.99.
pub fn build(&mut self) -> LanguageDetector
[src]
Creates and returns the configured instance of
LanguageDetector
.
Auto Trait Implementations
impl RefUnwindSafe for LanguageDetectorBuilder
impl Send for LanguageDetectorBuilder
impl Sync for LanguageDetectorBuilder
impl Unpin for LanguageDetectorBuilder
impl UnwindSafe for LanguageDetectorBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,