4 releases

0.2.0 Jan 5, 2022
0.1.2 Aug 11, 2021
0.1.1 Apr 9, 2021
0.1.0 Apr 9, 2021

#245 in Internationalization (i18n)

Download history 4/week @ 2024-02-19 6/week @ 2024-02-26 68/week @ 2024-04-01

68 downloads per month

MIT license

1MB
6K SLoC

Lingo

N-Gram-Based natural language detection library.

Usage

Language detection

use lingo::Lingo;

fn main() {
    let textcat  = Lingo::new();
    let text     = "Hi there, this is a simple text written in what language?";
    let language = textcat.get_language(text).unwrap();

    println!("\"{}\" is written in \"{}\"", text, language);
}

Stopwords and Stemmers

Lingo provides stopwords and stemmers for some languages by wrapping third party libraries.

The usage is quite simple.

use lingo::Language;

fn main() {
    let stopwords = Language::English.stopwords()?;
    let stemmer   = Language::English.stemmer()?;
}

Dependencies

~3.5–6MB
~81K SLoC