whichlang.cr

Crystal bindings for Whichlang language detection library

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

  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

Repository

whichlang.cr

Owner
Statistic
  • 1
  • 1
  • 0
  • 0
  • 0
  • about 1 month ago
  • January 20, 2024
License

MIT License

Links
Synced at

Mon, 18 Nov 2024 14:02:47 GMT

Languages