PHPackages                             tarastalian/text-language-detect - 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. tarastalian/text-language-detect

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

tarastalian/text-language-detect
================================

Detects the language of a given piece of text.

04.6k↓13.3%PHP

Since May 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tarastalian/text-language-detect)[ Packagist](https://packagist.org/packages/tarastalian/text-language-detect)[ RSS](/packages/tarastalian-text-language-detect/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Text Language Detect
====================

[](#text-language-detect)

Detects the language of a given piece of text.

The package attempts to detect the language of a sample of text by correlating ranked 3-gram frequencies to a table of 3-gram frequencies of known languages.

It implements a version of a technique originally proposed by Cavnar &amp; Trenkle (1994): "N-Gram-Based Text Categorization".

This is a fork of [Text\_LanguageDetect](http://pear.php.net/package/Text_LanguageDetect) 0.3.0 (alpha).

Dependencies:
-------------

[](#dependencies)

```
PHP Version: PHP 5.3 or newer, PHP 7
PHP Extension: pcre
PHP Extension: mbstring (optional)

```

Usage example
-------------

[](#usage-example)

```
