PHPackages                             chibifr/language-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chibifr/language-detector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chibifr/language-detector
=========================

A PHP package that detects the language from a string and can learn new languages.

1.0.0(10y ago)121MITPHP

Since Dec 8Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ChibiFR/language-detector)[ Packagist](https://packagist.org/packages/chibifr/language-detector)[ RSS](/packages/chibifr-language-detector/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Language Detector
-----------------

[](#language-detector)

A PHP package that detects the language from a string and can learn new languages.

Installation
------------

[](#installation)

To install this package, make sure you have [composer](https://getcomposer.org/). Then, require it:

```
composer require chibifr/language-detector

```

Teach a new language
--------------------

[](#teach-a-new-language)

To teach a new language to the Language Detector, simply add a file to the src/languages directory named "your-newly-added-language.php". This file should return an array of words or characters of the language you are teaching the LanguageDetector.

This file should look like:

```
