Babylon is the simplest, easiest-to-use language detector.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cli
dataset
docs
resources
src
tests/unit
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
composer.json
mkdocs.yml
phpunit.xml

README.md

Babylon

Build Status Documentation Status License: MIT

Babylon is the simplest, easiest-to-use language detector.

Install

Via composer:

$ composer require programarivm/babylon

Instantiation

Instantiate a LanguageDetector to detect a text's language.

use Babylon\LanguageDetector;

$text = 'You will have your data soon, I remarked, pointing with my finger;
		this is the Brixton Road, and that is the house, if I am not very much
		mistaken.';

$isoCode = (new LanguageDetector($text))->detect();

Note: The text needs to be a few words length in order for the language to be detected correctly; otherwise false positives may take place.

Language Detection

Please read the Documentation to find out which languages can be detected so far, and also to learn how to add new ones easily.

License

The MIT License.

Contributions

Would you help make this library better? Contributions are welcome.

Many thanks.