Whichlang

This implements detect_language bindings from the Rust library Whichlang.

Supported Languages:

Ara
Cmn
Deu
Eng
Fra
Hin
Ita
Jpn
Kor
Nld
Por
Rus
Spa
Swe
Tur
Vie
Unknown

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      whichlang:
        github: bendangelo/whichlang.cr
  2. 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

  1. Fork it (https://github.com/bendangelo/whichlang.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors