
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Linguo detects the language of a given text using Free Language Detection API.
Install it from rubygems:
gem install linguo
If you're using Rails, add to your Gemfile:
gem 'linguo'
# gem 'linguo', :git => 'git://github.com/NARKOZ/linguo.git'
and run:
bundle
You can run rails g linguo:config
to generate an initializer and set up API key at config/initializers/linguo.rb
.
You can use demo API key (demo
) to test out any examples below.
There are a few ways to set an API key. You can set default API key globally in Linguo::Config.api_key
:
Linguo.api_key = "your_api_key"
or set the environment variable 'LINGUO_API_KEY'
and Linguo will use it.
You can also pass it directly:
Linguo.detect("your text to detect", "your_api_key")
Identify text language and get confidence scores using the detect
method:
Linguo.detect("こんにちは")
Get a list of languages with confidence greater than 0.3:
Linguo.detect("こんにちは").detections.map {|x| x['language'] if x['confidence'] > 0.3}.compact
Linguo adds lang
method to String
class:
"こんにちは".lang
It will return an array containing detected languages.
For more information, refer to documentation.
Released under the BSD 2-clause license. See LICENSE.txt for details.
FAQs
Unknown package
We found that linguo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.