Function whatlang::detect

source ·
pub fn detect(text: &str) -> Option<Info>
Expand description

Detect a language and a script by a given text.

Example

use whatlang::{detect_lang, Lang};
let lang = detect_lang("There is no reason not to learn Esperanto.").unwrap();
assert_eq!(lang, Lang::Eng);