https://github.com/crodas/lingo-rs
Standalone library and program for natural language classification.
https://github.com/crodas/lingo-rs
categorization detection language rust text
Last synced: about 1 year ago
JSON representation
Standalone library and program for natural language classification.
- Host: GitHub
- URL: https://github.com/crodas/lingo-rs
- Owner: crodas
- License: mit
- Created: 2021-04-09T23:55:06.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2022-01-05T23:37:26.000Z (over 4 years ago)
- Last Synced: 2025-02-28T09:13:54.531Z (about 1 year ago)
- Topics: categorization, detection, language, rust, text
- Language: Rust
- Homepage:
- Size: 1.12 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lingo
N-Gram-Based natural language detection library.
## Usage
### Language detection
```rust
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.
```rust
use lingo::Language;
fn main() {
let stopwords = Language::English.stopwords()?;
let stemmer = Language::English.stemmer()?;
}
```