Skip to content

Crystal bindings for Whichlang language detection library

License

Notifications You must be signed in to change notification settings

bendangelo/whichlang.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Crystal bindings for Whichlang language detection library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published