compact language detection in ruby
Switch branches/tags
Nothing to show
Clone or download
Latest commit bd4e4a1 Dec 10, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ext/cld fix: add -Wno-narrowing to compiler flags so it compiles on modern sy… Nov 19, 2018
lib v0.8.0 Dec 10, 2018
spec Made detect language support underlying HTML mode. May 16, 2012
.gitignore build ext before running tests Nov 19, 2018
.rspec Added tests Feb 5, 2012
Gemfile add bump for easy gem bumping Nov 19, 2018
LICENSE Initial import Nov 3, 2011
README.md version bump Feb 11, 2012
Rakefile add bump for easy gem bumping Nov 19, 2018
cld.gemspec slim down gemspec Nov 19, 2018

README.md

Compact Language Detection

Blazing-fast language detection for Ruby provided by Google Chrome's Compact Language Detector.

How to Use

CLD.detect_language("This is a test")
# => {:name => "ENGLISH", :code => "en", :reliable => true}

CLD.detect_language("plus ça change, plus c'est la même chose")
# => {:name => "FRENCH", :code => "fr", :reliable => true}

Installation

Add this line to your application's Gemfile:

gem "cld"

And then execute:

$ bundle

Thanks

Thanks to the Chrome authors, and to Mike McCandless for writing a Python version.

Licensed the same as Chrome. Jason Toy