language-detector

A fast and reliable PHP library for detecting languages

MIT License

Downloads
314.6K
Stars
118
language-detector - LanguageDetector 1.4.0 Latest Release

Published by landrok 10 months ago

  • Switch CI to Github actions
  • Remove dead code
  • Add support for PHP 8.2 and 8.3
  • Remove support for PHP 7.2 and 7.3
language-detector - LanguageDetector 1.3.1

Published by landrok over 3 years ago

  • Add strict mode for type declarations
  • Remove support for PHP 7.0 and 7.1
  • Thanks to @deevroman Fix fatal error when static detection with restricted subsets (#6)
language-detector - LanguageDetector 1.3.0

Published by landrok about 4 years ago

Features

  • Thanks to @crishoj Loaded models can be limited with an array of ISO codes : $detector = new LanguageDetector(null, ['de', 'en', 'es', 'fr']);
  • LanguageDetector::getLanguages() returns an array of ISO codes. It's the list of models that are currently loaded and that will be evaluated.
  • Static method detect() now accepts an array of ISO codes as a second parameter : echo LanguageDetector::detect($text, ['de', 'en', 'es', 'fr']);
  • Now supports PHP 7.4 and 8.0
language-detector - LanguageDetector 1.2.0

Published by landrok almost 6 years ago

Features

  • LanguageDetector instance can be used as a string (__toString())
    echo $detector; prints ISO code
  • One line of code with the new detect() static method echo LanguageDetector::detect($text);
  • Library installation is blocked via composer if mbstring extension is not compiled.
  • Now supports Klingon language
language-detector - LanguageDetector 1.1.0

Published by landrok almost 6 years ago

Features

  • Add official support for PHP 7.1, 7.2 and 7.3

Deprecated

  • Remove support for PHP 5

Documentation

  • Add examples
language-detector - LanguageDetector 1.0.2

Published by landrok almost 8 years ago

Tests

  • Improve exception tests

Licence

  • Add license information in PHP files

Documentation

  • Fix typos
language-detector - LanguageDetector 1.0.1

Published by landrok almost 8 years ago

Performance

  • Execution time divided by 3
  • A little bit less RAM consumption

Licence

  • MIT licence
language-detector - LanguageDetector 1.0.0

Published by landrok almost 8 years ago

Features

  • More than 50 supported languages
  • Very fast, no database needed
  • Packaged with a 2MB learned dataset
  • N-grams algorithm
  • Supports PHP 5.4, 5.5, 5.6, 7.0, 7.1 and HHVM