whichlang
Whichlang
This implements detect_language
bindings from the Rust library Whichlang.
- Works on Linux / Mac only.
- Requires at least Rust 1.56.
Supported Languages:
Ara
Cmn
Deu
Eng
Fra
Hin
Ita
Jpn
Kor
Nld
Por
Rus
Spa
Swe
Tur
Vie
Unknown
Installation
-
Add the dependency to your
shard.yml
:dependencies: whichlang: github: bendangelo/whichlang.cr
-
Run
shards install
Usage
require "whichlang"
input = "this is the best day ever"
Whichlang.detect(input) # => Whichlang::Lang::Eng
# for nil responses
input = " "
Whichlang.detect?(input) # => nil
Development
make && crystal spec
Contributing
- Fork it (https://github.com/bendangelo/whichlang.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Ben D'Angelo - creator and maintainer