[−][src]Struct lingua::LanguageDetector
This struct detects the language of given input text.
Implementations
impl LanguageDetector
[src]
pub fn detect_language_of<T: Into<String>>(&self, text: T) -> Option<Language>
[src]
Detects the language of given input text.
If the language cannot be reliably detected, None
is returned.
pub fn compute_language_confidence_values<T: Into<String>>(
&self,
text: T
) -> Vec<(Language, f64)>
[src]
&self,
text: T
) -> Vec<(Language, f64)>
Computes confidence values for each language considered possible for the given input text.
The values that this method computes are part of a relative confidence metric, not of an absolute one. Each value is a number between 0.0 and 1.0. The most likely language is always returned with value 1.0. All other languages get values assigned which are lower than 1.0, denoting how less likely those languages are in comparison to the most likely language.
The vector returned by this method does not necessarily contain all languages which the
calling instance of LanguageDetector
was built from. If the rule-based engine decides
that a specific language is truly impossible, then it will not be part of the returned
vector. Likewise, if no ngram probabilities can be found within the detector's languages
for the given input text, the returned vector will be empty. The confidence value for
each language not being part of the returned vector is assumed to be 0.0.
Auto Trait Implementations
impl RefUnwindSafe for LanguageDetector
impl Send for LanguageDetector
impl Sync for LanguageDetector
impl Unpin for LanguageDetector
impl UnwindSafe for LanguageDetector
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>,