Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akihikodaki/cld3-ruby
cld3-ruby is an interface of Compact Language Detector v3 (CLD3) for Ruby.
https://github.com/akihikodaki/cld3-ruby
chrome ffi rubygems
Last synced: 3 months ago
JSON representation
cld3-ruby is an interface of Compact Language Detector v3 (CLD3) for Ruby.
- Host: GitHub
- URL: https://github.com/akihikodaki/cld3-ruby
- Owner: akihikodaki
- License: apache-2.0
- Created: 2017-05-05T01:07:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-17T06:05:48.000Z (over 1 year ago)
- Last Synced: 2024-06-18T23:14:36.444Z (5 months ago)
- Topics: chrome, ffi, rubygems
- Language: Ruby
- Size: 80.1 KB
- Stars: 76
- Watchers: 6
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# cld3-ruby
cld3-ruby is an interface of [Compact Language Detector v3 (CLD3)](https://github.com/google/cld3) for Ruby.## Usage
```ruby
require 'cld3'cld3 = CLD3::NNetLanguageIdentifier.new(0, 1000)
cld3.find_language("こんにちは") # => #
cld3.find_language("This is a pen.") # => #
cld3.find_language("здравствуйте") # => #
```## Installation
### Prerequisites
* [Bundler](http://bundler.io/)
* C++ compiler
* [RubyGems](https://rubygems.org/)### 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 `bundle exec 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/
### Troubleshooting
`gem install cld3` triggers native library building. If it fails, it is likely
that some required facilities are missing. Make sure C++ compiler is installed.
I recommend [GCC](https://gcc.gnu.org/) as a C++ compiler.If you cannot identify the cause of your problem, run spec of this library and
see whether the problem is reproducible with it or not. Spec is not included in
the gem, so clone the source code repository and then run
`bundle exec 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](https://www.apache.org/licenses/LICENSE-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.