All Projects → akihikodaki → cld3-ruby

akihikodaki / cld3-ruby

Licence: Apache-2.0 License
cld3-ruby is an interface of Compact Language Detector v3 (CLD3) for Ruby.

Programming Languages

ruby
36898 projects - #4 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to cld3-ruby

generic-linked-in-driver
A generic non-blocking linked-in driver for interfacing Erlang and C
Stars: ✭ 46 (-22.03%)
Mutual labels:  ffi
mozilla-deepspeech-flutter
Mozilla DeepSpeech in flutter using Dart FFI
Stars: ✭ 23 (-61.02%)
Mutual labels:  ffi
ffi-libc
Useful Ruby FFI bindings for libc
Stars: ✭ 32 (-45.76%)
Mutual labels:  ffi
purescript-ffi-utils
A utility library for the purescript foreign function interface
Stars: ✭ 22 (-62.71%)
Mutual labels:  ffi
PhpWebcam
This is a PHP library to capture webcam frames
Stars: ✭ 33 (-44.07%)
Mutual labels:  ffi
jquery-datatables
Jquery datatables ruby gems for assets pipeline
Stars: ✭ 73 (+23.73%)
Mutual labels:  rubygems
winsafe
Windows API and GUI in safe, idiomatic Rust.
Stars: ✭ 110 (+86.44%)
Mutual labels:  ffi
renderdoc-rs
RenderDoc application bindings for Rust
Stars: ✭ 28 (-52.54%)
Mutual labels:  ffi
unixstring
An FFI-friendly null-terminated byte string
Stars: ✭ 19 (-67.8%)
Mutual labels:  ffi
capsulecd
Continuous Delivery for automating package releases (npm, cookbooks, gems, pip, jars, etc)
Stars: ✭ 96 (+62.71%)
Mutual labels:  rubygems
swift-bridge
swift-bridge facilitates Rust and Swift interop.
Stars: ✭ 260 (+340.68%)
Mutual labels:  ffi
cffi
Safe* C foreign function interface for Rust, using proc macros and marshaling types.
Stars: ✭ 15 (-74.58%)
Mutual labels:  ffi
codice fiscale
A Ruby gem that calculates the Italian Tax ID (Codice Fiscale)
Stars: ✭ 17 (-71.19%)
Mutual labels:  rubygems
eta-ffi
A command line tool to automate the generation of ffi import code for the bindings of various Java libraries.
Stars: ✭ 19 (-67.8%)
Mutual labels:  ffi
uapi
Unix API
Stars: ✭ 18 (-69.49%)
Mutual labels:  ffi
pybluemonday
pybluemonday is a library for sanitizing HTML very quickly via bluemonday.
Stars: ✭ 25 (-57.63%)
Mutual labels:  ffi
rust-lang-interop
Rust language interoperability with other languages - C, C++ etc.
Stars: ✭ 53 (-10.17%)
Mutual labels:  ffi
gpgme
GPGme bindings for Rust
Stars: ✭ 55 (-6.78%)
Mutual labels:  ffi
manpages
Gem to add man pages support to ruby gems
Stars: ✭ 38 (-35.59%)
Mutual labels:  rubygems
termichunk
Organize chunks of text within terminals
Stars: ✭ 12 (-79.66%)
Mutual labels:  rubygems

cld3-ruby

cld3-ruby is an interface of Compact Language Detector v3 (CLD3) for Ruby.

Usage

require 'cld3'

cld3 = CLD3::NNetLanguageIdentifier.new(0, 1000)

cld3.find_language("こんにちは") # => #<struct Struct::Result language=:ja, probability=1.0, reliable?=true, proportion=1.0, byte_ranges=[]>

cld3.find_language("This is a pen.") # => #<struct Struct::Result language=:en, probability=0.9999408721923828, reliable?=true, proportion=1.0, byte_ranges=[]>

cld3.find_language("здравствуйте") # => #<struct Struct::Result language=:ru, probability=0.3140212297439575, reliable?=false, proportion=1.0, byte_ranges=[]>

Installation

Prerequisites

Instructions

I (Akihiko Odaki) recommend to setup this library installing via gem.

You can also build this library by yourself. Rakefile includes a Rake task to put this code into files buildable as a gem. Build a gem with rake command.

Platform-specific information

FreeBSD

FreeBSD port is available as rubygem-cld3 in textproc category.

https://svnweb.freebsd.org/ports/head/textproc/rubygem-cld3/

JRuby

JRuby has a bug which prevents the feature detection. Apply the following change: https://github.com/jruby/jruby/pull/4118/commits/edad375ef4dcf195b19ce0afe4befac66468c736

Troubleshooting

gem install cld3 triggers native library building. If it fails, you are likely to missing required facilities. Make sure C++ compiler and protocol buffers is installed. I recommend GCC as a C++ compiler. Ruby is likely to need pkg-config as well.

Runtime errors are likely to be issues of FFI or programming errors. Make sure they are all correct.

If you cannot identify the cause of your problem, run spec of this library and see whether the problem is reproducable with it or not. Spec is not included in the gem, so clone the source code repository and then run rake spec. The source code repository is at https://github.com/akihikodaki/cld3-ruby.

In case you cannot solve your problem by yourself and cannot help abandoning or find an issue in this library, please open an issue at https://github.com/akihikodaki/cld3-ruby/issues.

If you found an issue and managed to fix it and agree to share the fix under Apache-2.0, please open a pull request at https://github.com/akihikodaki/cld3-ruby/pulls. Your contribution would be appreciated by other users and recorded with Git.

Versioning

The version has 3 parts: major, minor, and patch. They are joined with . as delimiters in the order.

The increment of the major version and the minor version indicates it can involve any change.

The increment of the patch version indicates there is no change of the supported languages and no change of the existing APIs.

Contact

To ask questions or report issues please open issues at https://github.com/akihikodaki/cld3-ruby/issues.

Credits

This program was written by Akihiko Odaki and other contributors. CLD3 was written by its own authors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].