Sha256: 5b81a5be88d03009625f1ebeaa64be2b66a3e0f9ba5f226b099d91d1c951c132

Contents?: true

Size: 315 Bytes

Versions: 5

Compression:

Stored size: 315 Bytes

Contents

require "rubygems"
require "ffi"

module CLD
  extend FFI::Library
  dir = File.expand_path(File.join(File.dirname(__FILE__), "../ext/cld"))
  ffi_lib "#{dir}/cld.so"
  attach_function "detect_language","detectLanguageThunkInt", [:buffer_in], :int
  def self.english?(text)
    detect_language(text) == 0
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
krukid-cld-0.4.0 lib/cld.rb
cld-0.4.0 lib/cld.rb
cld-0.3.0 lib/cld.rb
cld-0.2.0 lib/cld.rb
cld-0.1.0 lib/cld.rb