Function whatlang::detect_script

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

Detect only a script by a given text. Works much faster than a complete detection with detect.

Example

use whatlang::{detect_script, Script};
let script = detect_script("Благодаря Эсперанто вы обрётете друзей по всему миру!").unwrap();
assert_eq!(script, Script::Cyrillic);