mirror of
https://github.com/friendica/friendica
synced 2024-11-11 17:02:57 +00:00
7d876aab98
- Updated mobiledetectlib to 2.8.26 - Updated PEAR to 1.10.5 - Updated Archive_Tar to 1.4.3 - Updated XML_Util to 1.4.3
35 lines
608 B
PHP
35 lines
608 B
PHP
<?php
|
|
|
|
/**
|
|
* example usage (CLI)
|
|
*
|
|
* @package Text_LanguageDetect
|
|
* @version CVS: $Id$
|
|
*/
|
|
|
|
require_once 'Text/LanguageDetect.php';
|
|
|
|
$l = new Text_LanguageDetect;
|
|
|
|
$stdin = fopen('php://stdin', 'r');
|
|
|
|
echo "Supported languages:\n";
|
|
$langs = $l->getLanguages();
|
|
sort($langs);
|
|
echo join(', ', $langs);
|
|
|
|
echo "\ntotal ", count($langs), "\n\n";
|
|
|
|
while ($line = fgets($stdin)) {
|
|
$result = $l->detect($line, 4);
|
|
print_r($result);
|
|
$blocks = $l->detectUnicodeBlocks($line, true);
|
|
print_r($blocks);
|
|
}
|
|
|
|
fclose($stdin);
|
|
unset($l);
|
|
|
|
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
|
|
|
?>
|