Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/craig-day/ruby_cld2

Ruby Wrapper for Google CLD2
https://github.com/craig-day/ruby_cld2

Last synced: 20 days ago
JSON representation

Ruby Wrapper for Google CLD2

Awesome Lists containing this project

README

        

# Compact Language Detection for Ruby

This is a ruby wrapper for Google [Compact Language Detector 2](https://code.google.com/p/cld2/).

## Usage
a. Include the Gem
```ruby
gem 'ruby_cld2', :git => '[email protected]:craig-day/ruby_cld2.git'
```
b. Call the function on a given string.
```ruby
require 'cld2'
#...
CLD2.detect_language("Hola mis amigos!")
=> {:name => "SPANISH", :code => "es", :reliable => true}
```

### Source
To get the source used to compile `ext/lib/libcld2.so` and `ext/lib/libcld2_full.so`
```
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://cld2.googlecode.com/svn/trunk/ cld2-read-only
```