https://github.com/skorfmann/detect-language
https://github.com/skorfmann/detect-language
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/skorfmann/detect-language
- Owner: skorfmann
- Created: 2013-02-24T05:47:03.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-24T06:05:08.000Z (over 12 years ago)
- Last Synced: 2025-04-08T05:45:27.852Z (6 months ago)
- Language: Ruby
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
#Detect Language
This little library can be trained to detect different languages by dropping arbitary text files in the corresponding languages into the "lang" directory.The actual language detection is performed by the [babel](http://github.com/simplificator/babel) gem, which is based on the n-gram approach by Cavnar and Trenkle.
## Quickstart
```bash
git clone https://github.com/skorfmann/detect-language.git
cd detect-language
bundle install
bundle exec rspec
./bin/detect-language ./lang/gaelic.1
=> detected language: gaelic
```## Detect language of a file
Use one of the training files for example:```bash
bin/detect-language ./lang/german.1
=> detected language: german
```## Run the specs
```bash
bundle exec rspec
```