Natural language detection in Rust.
The library is still in active development. Here is the short example how to use it:
Add to you Cargo.toml
:
```
[dependencies]
whatlang = "*" ```
In you program:
```rust extern crate whatlang;
use whatlang::{detect_lang, Lang, Script, Query};
fn main() { let text = "Guten Abend, meine Damen und Herren!".tostring(); let query = Query { text: &text }; let result = detectlang(query).unwrap(); asserteq!(result.lang, Lang::Deu); asserteq!(result.lang.tocode(), "deu"); asserteq!(result.script, Script::Latin); } ```
Query
structResult
structMIT