⬆️ Update Text_LanguageDetect.
Update from v0.3.0 (2012) to v1.0.0 (2017) which should remove some warnings and improve PHP7 support. Using composer to handle this PEAR library now. Fix a problem in FeedutilsTest.
This commit is contained in:
parent
fe5f1e4d67
commit
8e4c5db766
@ -33,7 +33,8 @@
|
|||||||
"bshaffer/oauth2-server-php": "^1.9",
|
"bshaffer/oauth2-server-php": "^1.9",
|
||||||
"ezyang/htmlpurifier": "^4.9",
|
"ezyang/htmlpurifier": "^4.9",
|
||||||
"simplepie/simplepie": "~1.5",
|
"simplepie/simplepie": "~1.5",
|
||||||
"league/html-to-markdown": "^4.4"
|
"league/html-to-markdown": "^4.4",
|
||||||
|
"pear/text_languagedetect": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"php" : ">=7.0",
|
"php" : ">=7.0",
|
||||||
|
70
composer.lock
generated
70
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "4a78983d966b7641fd532909d625c21a",
|
"content-hash": "50f781f18deef8573188a713376a711d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "bshaffer/oauth2-server-php",
|
"name": "bshaffer/oauth2-server-php",
|
||||||
@ -224,6 +224,50 @@
|
|||||||
],
|
],
|
||||||
"time": "2016-10-29T18:58:20+00:00"
|
"time": "2016-10-29T18:58:20+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "pear/text_languagedetect",
|
||||||
|
"version": "v1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/pear/Text_LanguageDetect.git",
|
||||||
|
"reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/bb9ff6f4970f686fac59081e916b456021fe7ba6",
|
||||||
|
"reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-mbstring": "May require the mbstring PHP extension"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Text": "./"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"include-path": [
|
||||||
|
"./"
|
||||||
|
],
|
||||||
|
"license": [
|
||||||
|
"BSD-2-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicholas Pisarro",
|
||||||
|
"email": "taak@php.net",
|
||||||
|
"role": "Lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Identify human languages from text samples",
|
||||||
|
"homepage": "http://pear.php.net/package/Text_LanguageDetect",
|
||||||
|
"time": "2017-03-02T16:14:08+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -276,12 +320,12 @@
|
|||||||
"version": "3.2.2",
|
"version": "3.2.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-dav.git",
|
"url": "https://github.com/sabre-io/dav.git",
|
||||||
"reference": "e987775e619728f12205606c9cc3ee565ffb1516"
|
"reference": "e987775e619728f12205606c9cc3ee565ffb1516"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516",
|
"url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516",
|
||||||
"reference": "e987775e619728f12205606c9cc3ee565ffb1516",
|
"reference": "e987775e619728f12205606c9cc3ee565ffb1516",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@ -359,12 +403,12 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-event.git",
|
"url": "https://github.com/sabre-io/event.git",
|
||||||
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534"
|
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534",
|
"url": "https://api.github.com/repos/sabre-io/event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534",
|
||||||
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534",
|
"reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@ -416,12 +460,12 @@
|
|||||||
"version": "4.2.3",
|
"version": "4.2.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-http.git",
|
"url": "https://github.com/sabre-io/http.git",
|
||||||
"reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93"
|
"reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-http/zipball/0295f9a3ee39be97e0898592fc19e42421e0cd93",
|
"url": "https://api.github.com/repos/sabre-io/http/zipball/0295f9a3ee39be97e0898592fc19e42421e0cd93",
|
||||||
"reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93",
|
"reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@ -472,12 +516,12 @@
|
|||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-uri.git",
|
"url": "https://github.com/sabre-io/uri.git",
|
||||||
"reference": "ada354d83579565949d80b2e15593c2371225e61"
|
"reference": "ada354d83579565949d80b2e15593c2371225e61"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-uri/zipball/ada354d83579565949d80b2e15593c2371225e61",
|
"url": "https://api.github.com/repos/sabre-io/uri/zipball/ada354d83579565949d80b2e15593c2371225e61",
|
||||||
"reference": "ada354d83579565949d80b2e15593c2371225e61",
|
"reference": "ada354d83579565949d80b2e15593c2371225e61",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@ -523,12 +567,12 @@
|
|||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-vobject.git",
|
"url": "https://github.com/sabre-io/vobject.git",
|
||||||
"reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c"
|
"reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-vobject/zipball/d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
|
"url": "https://api.github.com/repos/sabre-io/vobject/zipball/d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
|
||||||
"reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
|
"reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
@ -620,12 +664,12 @@
|
|||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fruux/sabre-xml.git",
|
"url": "https://github.com/sabre-io/xml.git",
|
||||||
"reference": "59b20e5bbace9912607481634f97d05a776ffca7"
|
"reference": "59b20e5bbace9912607481634f97d05a776ffca7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fruux/sabre-xml/zipball/59b20e5bbace9912607481634f97d05a776ffca7",
|
"url": "https://api.github.com/repos/sabre-io/xml/zipball/59b20e5bbace9912607481634f97d05a776ffca7",
|
||||||
"reference": "59b20e5bbace9912607481634f97d05a776ffca7",
|
"reference": "59b20e5bbace9912607481634f97d05a776ffca7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
|
@ -120,8 +120,12 @@ function preg_callback_help_include($matches) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @return boolean|array
|
||||||
|
*/
|
||||||
function determine_help_language() {
|
function determine_help_language() {
|
||||||
require_once('Text/LanguageDetect.php');
|
|
||||||
$lang_detect = new Text_LanguageDetect();
|
$lang_detect = new Text_LanguageDetect();
|
||||||
// Set this mode to recognize language by the short code like "en", "ru", etc.
|
// Set this mode to recognize language by the short code like "en", "ru", etc.
|
||||||
$lang_detect->setNameMode(2);
|
$lang_detect->setNameMode(2);
|
||||||
@ -134,8 +138,10 @@ function determine_help_language() {
|
|||||||
$lang = \App::$language;
|
$lang = \App::$language;
|
||||||
if(! isset($lang))
|
if(! isset($lang))
|
||||||
$lang = 'en';
|
$lang = 'en';
|
||||||
|
|
||||||
$from_url = false;
|
$from_url = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('language' => $lang, 'from_url' => $from_url);
|
return array('language' => $lang, 'from_url' => $from_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,11 +243,9 @@ function string_plural_select_default($n) {
|
|||||||
*
|
*
|
||||||
* @see http://pear.php.net/package/Text_LanguageDetect
|
* @see http://pear.php.net/package/Text_LanguageDetect
|
||||||
* @param string $s A string to examine
|
* @param string $s A string to examine
|
||||||
* @return Language code in 2-letter ISO 639-1 (en, de, fr) format
|
* @return string Language code in 2-letter ISO 639-1 (en, de, fr) format
|
||||||
*/
|
*/
|
||||||
function detect_language($s) {
|
function detect_language($s) {
|
||||||
require_once('Text/LanguageDetect.php');
|
|
||||||
|
|
||||||
$min_length = get_config('system', 'language_detect_min_length');
|
$min_length = get_config('system', 'language_detect_min_length');
|
||||||
if ($min_length === false)
|
if ($min_length === false)
|
||||||
$min_length = LANGUAGE_DETECT_MIN_LENGTH;
|
$min_length = LANGUAGE_DETECT_MIN_LENGTH;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* example usage (CLI)
|
|
||||||
*
|
|
||||||
* @package Text_LanguageDetect
|
|
||||||
* @version CVS: $Id: example_clui.php 322305 2012-01-15 00:04:17Z clockwerx $
|
|
||||||
*/
|
|
||||||
|
|
||||||
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: */
|
|
||||||
|
|
||||||
?>
|
|
@ -1,72 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* example usage (web)
|
|
||||||
*
|
|
||||||
* @package Text_LanguageDetect
|
|
||||||
* @version CVS: $Id: example_web.php 205493 2006-01-18 00:26:57Z taak $
|
|
||||||
*/
|
|
||||||
|
|
||||||
// browsers will encode multi-byte characters wrong unless they think the page is utf8-encoded
|
|
||||||
header('Content-type: text/html; charset=utf-8', true);
|
|
||||||
|
|
||||||
require_once 'Text/LanguageDetect.php';
|
|
||||||
|
|
||||||
$l = new Text_LanguageDetect;
|
|
||||||
if (isset($_REQUEST['q'])) {
|
|
||||||
$q = stripslashes($_REQUEST['q']);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Text_LanguageDetect demonstration</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h2>Text_LanguageDetect</h2>
|
|
||||||
<?
|
|
||||||
echo "<small>Supported languages:\n";
|
|
||||||
$langs = $l->getLanguages();
|
|
||||||
sort($langs);
|
|
||||||
foreach ($langs as $lang) {
|
|
||||||
echo ucfirst($lang), ', ';
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<br />total $i</small><br /><br />";
|
|
||||||
|
|
||||||
?>
|
|
||||||
<form method="post">
|
|
||||||
Enter text to identify language (at least a couple of sentences):<br />
|
|
||||||
<textarea name="q" wrap="virtual" cols="80" rows="8"><?= $q ?></textarea>
|
|
||||||
<br />
|
|
||||||
<input type="submit" value="Submit" />
|
|
||||||
</form>
|
|
||||||
<?
|
|
||||||
if (isset($q) && strlen($q)) {
|
|
||||||
$len = $l->utf8strlen($q);
|
|
||||||
if ($len < 20) { // this value picked somewhat arbitrarily
|
|
||||||
echo "Warning: string not very long ($len chars)<br />\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $l->detectConfidence($q);
|
|
||||||
|
|
||||||
if ($result == null) {
|
|
||||||
echo "Text_LanguageDetect cannot identify this piece of text. <br /><br />\n";
|
|
||||||
} else {
|
|
||||||
echo "Text_LanguageDetect thinks this text is written in <b>{$result['language']}</b> ({$result['similarity']}, {$result['confidence']})<br /><br />\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $l->detectUnicodeBlocks($q, false);
|
|
||||||
if (!empty($result)) {
|
|
||||||
arsort($result);
|
|
||||||
echo "Unicode blocks present: ", join(', ', array_keys($result)), "\n<br /><br />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($l);
|
|
||||||
|
|
||||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
|
||||||
|
|
||||||
?>
|
|
||||||
</body></html>
|
|
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Demonstrates how to use ISO language codes.
|
|
||||||
*
|
|
||||||
* The "name mode" changes the way languages are accepted and returned.
|
|
||||||
*/
|
|
||||||
require_once 'Text/LanguageDetect.php';
|
|
||||||
$l = new Text_LanguageDetect();
|
|
||||||
|
|
||||||
|
|
||||||
//will output the ISO 639-1 two-letter language code
|
|
||||||
// "de"
|
|
||||||
$l->setNameMode(2);
|
|
||||||
echo $l->detectSimple('Das ist ein kleiner Text') . "\n";
|
|
||||||
|
|
||||||
//will output the ISO 639-2 three-letter language code
|
|
||||||
// "deu"
|
|
||||||
$l->setNameMode(3);
|
|
||||||
echo $l->detectSimple('Das ist ein kleiner Text') . "\n";
|
|
||||||
|
|
||||||
?>
|
|
File diff suppressed because it is too large
Load Diff
@ -1,72 +0,0 @@
|
|||||||
<?php
|
|
||||||
set_include_path(
|
|
||||||
__DIR__ . '/../' . PATH_SEPARATOR . get_include_path()
|
|
||||||
);
|
|
||||||
|
|
||||||
require_once 'Text/LanguageDetect/ISO639.php';
|
|
||||||
|
|
||||||
class Text_LanguageDetect_ISO639Test extends PHPUnit_Framework_TestCase
|
|
||||||
{
|
|
||||||
public function testNameToCode2()
|
|
||||||
{
|
|
||||||
$this->assertEquals(
|
|
||||||
'de',
|
|
||||||
Text_LanguageDetect_ISO639::nameToCode2('german')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testNameToCode2Fail()
|
|
||||||
{
|
|
||||||
$this->assertNull(
|
|
||||||
Text_LanguageDetect_ISO639::nameToCode2('doesnotexist')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testNameToCode3()
|
|
||||||
{
|
|
||||||
$this->assertEquals(
|
|
||||||
'fra',
|
|
||||||
Text_LanguageDetect_ISO639::nameToCode3('french')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testNameToCode3Fail()
|
|
||||||
{
|
|
||||||
$this->assertNull(
|
|
||||||
Text_LanguageDetect_ISO639::nameToCode3('doesnotexist')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCode2ToName()
|
|
||||||
{
|
|
||||||
$this->assertEquals(
|
|
||||||
'english',
|
|
||||||
Text_LanguageDetect_ISO639::code2ToName('en')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCode2ToNameFail()
|
|
||||||
{
|
|
||||||
$this->assertNull(
|
|
||||||
Text_LanguageDetect_ISO639::code2ToName('nx')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCode3ToName()
|
|
||||||
{
|
|
||||||
$this->assertEquals(
|
|
||||||
'romanian',
|
|
||||||
Text_LanguageDetect_ISO639::code3ToName('rom')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testCode3ToNameFail()
|
|
||||||
{
|
|
||||||
$this->assertNull(
|
|
||||||
Text_LanguageDetect_ISO639::code3ToName('nxx')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@ -24,7 +24,9 @@ class FeedutilsTest extends UnitTestCase {
|
|||||||
$b = ['attribs' => ['' => [
|
$b = ['attribs' => ['' => [
|
||||||
'rel' => 'rel_value',
|
'rel' => 'rel_value',
|
||||||
'type' => 'type_value',
|
'type' => 'type_value',
|
||||||
'href' => 'href_value'
|
'href' => 'href_value',
|
||||||
|
'length' => 'length_value',
|
||||||
|
'title' => 'title_value'
|
||||||
]]];
|
]]];
|
||||||
$blink1 = ['link1' => $b];
|
$blink1 = ['link1' => $b];
|
||||||
$bresult[] = $b['attribs'][''];
|
$bresult[] = $b['attribs'][''];
|
||||||
@ -37,6 +39,9 @@ class FeedutilsTest extends UnitTestCase {
|
|||||||
//Illegal string offset 'attribs'
|
//Illegal string offset 'attribs'
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses ::xmlify
|
||||||
|
*/
|
||||||
public function test_atom_author() {
|
public function test_atom_author() {
|
||||||
$this->assertEquals('', atom_author('', 'nick', 'name', 'uri', 72, 72, 'png', 'photourl'));
|
$this->assertEquals('', atom_author('', 'nick', 'name', 'uri', 72, 72, 'png', 'photourl'));
|
||||||
|
|
||||||
@ -47,7 +52,7 @@ class FeedutilsTest extends UnitTestCase {
|
|||||||
<link rel="photo" type="png" media:width="72" media:height="72" href="http://photourl" />
|
<link rel="photo" type="png" media:width="72" media:height="72" href="http://photourl" />
|
||||||
<link rel="avatar" type="png" media:width="72" media:height="72" href="http://photourl" />
|
<link rel="avatar" type="png" media:width="72" media:height="72" href="http://photourl" />
|
||||||
<poco:preferredUsername>nick</poco:preferredUsername>
|
<poco:preferredUsername>nick</poco:preferredUsername>
|
||||||
<poco:displayName>name<poco:displayName>
|
<poco:displayName>name</poco:displayName>
|
||||||
</tag>';
|
</tag>';
|
||||||
|
|
||||||
$this->assertXmlStringEqualsXmlString($a, atom_author('tag', 'nick', 'name', 'uri', 72, 72, 'png', 'http://photourl'));
|
$this->assertXmlStringEqualsXmlString($a, atom_author('tag', 'nick', 'name', 'uri', 72, 72, 'png', 'http://photourl'));
|
@ -52,7 +52,6 @@ class LanguageTest extends UnitTestCase {
|
|||||||
|
|
||||||
// Can not unit test detect_language(), therefore test the used library
|
// Can not unit test detect_language(), therefore test the used library
|
||||||
// only for now to find regressions on library updates.
|
// only for now to find regressions on library updates.
|
||||||
require_once('library/langdet/Text/LanguageDetect.php');
|
|
||||||
$l = new Text_LanguageDetect;
|
$l = new Text_LanguageDetect;
|
||||||
// return 2-letter ISO 639-1 (en) language code
|
// return 2-letter ISO 639-1 (en) language code
|
||||||
$l->setNameMode(2);
|
$l->setNameMode(2);
|
||||||
@ -71,8 +70,8 @@ class LanguageTest extends UnitTestCase {
|
|||||||
],
|
],
|
||||||
'English' => [
|
'English' => [
|
||||||
'English is a West Germanic language that was first spoken in early medieval England and is now a global lingua franca.[4][5] Named after the Angles, one of the Germanic tribes that migrated to England, it ultimately derives its name from the Anglia (Angeln) peninsula in the Baltic Sea. It is closely related to the Frisian languages, but its vocabulary has been significantly influenced by other Germanic languages, particularly Norse (a North Germanic language), as well as by Latin and Romance languages, especially French.',
|
'English is a West Germanic language that was first spoken in early medieval England and is now a global lingua franca.[4][5] Named after the Angles, one of the Germanic tribes that migrated to England, it ultimately derives its name from the Anglia (Angeln) peninsula in the Baltic Sea. It is closely related to the Frisian languages, but its vocabulary has been significantly influenced by other Germanic languages, particularly Norse (a North Germanic language), as well as by Latin and Romance languages, especially French.',
|
||||||
'da', // nearly impossible to find a wikipedia article which is detected as english
|
'en',
|
||||||
0.000367 // minimum confidence is checked in detect_language(), but that is not yet unit testable
|
0.078422
|
||||||
],
|
],
|
||||||
'German' => [
|
'German' => [
|
||||||
'Deutschland ist ein Bundesstaat in Mitteleuropa. Er besteht aus 16 Ländern und ist als freiheitlich-demokratischer und sozialer Rechtsstaat verfasst. Die Bundesrepublik Deutschland stellt die jüngste Ausprägung des deutschen Nationalstaates dar. Mit rund 82,8 Millionen Einwohnern (31. Dezember 2016) zählt Deutschland zu den dicht besiedelten Flächenstaaten.',
|
'Deutschland ist ein Bundesstaat in Mitteleuropa. Er besteht aus 16 Ländern und ist als freiheitlich-demokratischer und sozialer Rechtsstaat verfasst. Die Bundesrepublik Deutschland stellt die jüngste Ausprägung des deutschen Nationalstaates dar. Mit rund 82,8 Millionen Einwohnern (31. Dezember 2016) zählt Deutschland zu den dicht besiedelten Flächenstaaten.',
|
||||||
|
10
vendor/composer/include_paths.php
vendored
Normal file
10
vendor/composer/include_paths.php
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// include_paths.php @generated by Composer
|
||||||
|
|
||||||
|
$vendorDir = dirname(dirname(__FILE__));
|
||||||
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
$vendorDir . '/pear/text_languagedetect',
|
||||||
|
);
|
157
vendor/pear/text_languagedetect/README.rst
vendored
Normal file
157
vendor/pear/text_languagedetect/README.rst
vendored
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
*******************
|
||||||
|
Text_LanguageDetect
|
||||||
|
*******************
|
||||||
|
PHP library to identify human languages from text samples.
|
||||||
|
Returns confidence scores for each.
|
||||||
|
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
PEAR
|
||||||
|
----
|
||||||
|
::
|
||||||
|
|
||||||
|
$ pear install Text_LanguageDetect
|
||||||
|
|
||||||
|
Composer
|
||||||
|
--------
|
||||||
|
::
|
||||||
|
|
||||||
|
$ composer require pear/text_languagedetect
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
Also see the examples in the ``docs/`` directory and
|
||||||
|
the `official documentation`__.
|
||||||
|
|
||||||
|
__ http://pear.php.net/package/Text_LanguageDetect/docs
|
||||||
|
|
||||||
|
Language detection
|
||||||
|
------------------
|
||||||
|
Simple language detection::
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once 'Text/LanguageDetect.php';
|
||||||
|
|
||||||
|
$text = 'Was wäre, wenn ich Ihnen das jetzt sagen würde?';
|
||||||
|
|
||||||
|
$ld = new Text_LanguageDetect();
|
||||||
|
$language = $ld->detectSimple($text);
|
||||||
|
|
||||||
|
echo $language;
|
||||||
|
//output: german
|
||||||
|
|
||||||
|
Show the three most probable languages with their confidence score::
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once 'Text/LanguageDetect.php';
|
||||||
|
|
||||||
|
$text = 'Was wäre, wenn ich Ihnen das jetzt sagen würde?';
|
||||||
|
|
||||||
|
$ld = new Text_LanguageDetect();
|
||||||
|
//3 most probable languages
|
||||||
|
$results = $ld->detect($text, 3);
|
||||||
|
|
||||||
|
foreach ($results as $language => $confidence) {
|
||||||
|
echo $language . ': ' . number_format($confidence, 2) . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//output:
|
||||||
|
//german: 0.35
|
||||||
|
//dutch: 0.25
|
||||||
|
//swedish: 0.20
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
Language code
|
||||||
|
-------------
|
||||||
|
Instead of returning the full language name, ISO 639-2 two and three
|
||||||
|
letter codes can be returned::
|
||||||
|
|
||||||
|
<?php
|
||||||
|
require_once 'Text/LanguageDetect.php';
|
||||||
|
$ld = new Text_LanguageDetect();
|
||||||
|
|
||||||
|
//will output the ISO 639-1 two-letter language code
|
||||||
|
// "de"
|
||||||
|
$ld->setNameMode(2);
|
||||||
|
echo $ld->detectSimple('Das ist ein kleiner Text') . "\n";
|
||||||
|
|
||||||
|
//will output the ISO 639-2 three-letter language code
|
||||||
|
// "deu"
|
||||||
|
$ld->setNameMode(3);
|
||||||
|
echo $ld->detectSimple('Das ist ein kleiner Text') . "\n";
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
Supported languages
|
||||||
|
===================
|
||||||
|
- albanian
|
||||||
|
- arabic
|
||||||
|
- azeri
|
||||||
|
- bengali
|
||||||
|
- bulgarian
|
||||||
|
- cebuano
|
||||||
|
- croatian
|
||||||
|
- czech
|
||||||
|
- danish
|
||||||
|
- dutch
|
||||||
|
- english
|
||||||
|
- estonian
|
||||||
|
- farsi
|
||||||
|
- finnish
|
||||||
|
- french
|
||||||
|
- german
|
||||||
|
- hausa
|
||||||
|
- hawaiian
|
||||||
|
- hindi
|
||||||
|
- hungarian
|
||||||
|
- icelandic
|
||||||
|
- indonesian
|
||||||
|
- italian
|
||||||
|
- kazakh
|
||||||
|
- kyrgyz
|
||||||
|
- latin
|
||||||
|
- latvian
|
||||||
|
- lithuanian
|
||||||
|
- macedonian
|
||||||
|
- mongolian
|
||||||
|
- nepali
|
||||||
|
- norwegian
|
||||||
|
- pashto
|
||||||
|
- pidgin
|
||||||
|
- polish
|
||||||
|
- portuguese
|
||||||
|
- romanian
|
||||||
|
- russian
|
||||||
|
- serbian
|
||||||
|
- slovak
|
||||||
|
- slovene
|
||||||
|
- somali
|
||||||
|
- spanish
|
||||||
|
- swahili
|
||||||
|
- swedish
|
||||||
|
- tagalog
|
||||||
|
- turkish
|
||||||
|
- ukrainian
|
||||||
|
- urdu
|
||||||
|
- uzbek
|
||||||
|
- vietnamese
|
||||||
|
- welsh
|
||||||
|
|
||||||
|
|
||||||
|
Links
|
||||||
|
=====
|
||||||
|
Homepage
|
||||||
|
http://pear.php.net/package/Text_LanguageDetect
|
||||||
|
Bug tracker
|
||||||
|
http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Text_LanguageDetect
|
||||||
|
Documentation
|
||||||
|
http://pear.php.net/package/Text_LanguageDetect/docs
|
||||||
|
Unit test status
|
||||||
|
https://travis-ci.org/pear/Text_LanguageDetect
|
||||||
|
|
||||||
|
.. image:: https://travis-ci.org/pear/Text_LanguageDetect.svg?branch=master
|
||||||
|
:target: https://travis-ci.org/pear/Text_LanguageDetect
|
@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Part of Text_LanguageDetect
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Text
|
||||||
|
* @package Text_LanguageDetect
|
||||||
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
|
* @copyright 2005-2006 Nicholas Pisarro
|
||||||
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
|
*/
|
||||||
|
|
||||||
|
//require_once 'Text/LanguageDetect/Exception.php';
|
||||||
|
//require_once 'Text/LanguageDetect/Parser.php';
|
||||||
|
//require_once 'Text/LanguageDetect/ISO639.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects the language of a given piece of text.
|
* Detects the language of a given piece of text.
|
||||||
@ -9,26 +25,7 @@
|
|||||||
* Implements a version of a technique originally proposed by Cavnar & Trenkle
|
* Implements a version of a technique originally proposed by Cavnar & Trenkle
|
||||||
* (1994): "N-Gram-Based Text Categorization"
|
* (1994): "N-Gram-Based Text Categorization"
|
||||||
*
|
*
|
||||||
* PHP version 5
|
* Requires the language model database (lang.dat) that should have
|
||||||
*
|
|
||||||
* @category Text
|
|
||||||
* @package Text_LanguageDetect
|
|
||||||
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
|
||||||
* @copyright 2005-2006 Nicholas Pisarro
|
|
||||||
* @license http://www.debian.org/misc/bsd.license BSD
|
|
||||||
* @version SVN: $Id: LanguageDetect.php 322353 2012-01-16 08:41:43Z cweiske $
|
|
||||||
* @link http://pear.php.net/package/Text_LanguageDetect/
|
|
||||||
* @link http://langdetect.blogspot.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once 'Text/LanguageDetect/Exception.php';
|
|
||||||
require_once 'Text/LanguageDetect/Parser.php';
|
|
||||||
require_once 'Text/LanguageDetect/ISO639.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Language detection class
|
|
||||||
*
|
|
||||||
* Requires the langauge model database (lang.dat) that should have
|
|
||||||
* accompanied this class definition in order to be instantiated.
|
* accompanied this class definition in order to be instantiated.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
@ -60,10 +57,9 @@ require_once 'Text/LanguageDetect/ISO639.php';
|
|||||||
* @package Text_LanguageDetect
|
* @package Text_LanguageDetect
|
||||||
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
* @copyright 2005 Nicholas Pisarro
|
* @copyright 2005 Nicholas Pisarro
|
||||||
* @license http://www.debian.org/misc/bsd.license BSD
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
* @link http://pear.php.net/package/Text_LanguageDetect/
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
* @todo allow users to generate their own language models
|
|
||||||
*/
|
*/
|
||||||
class Text_LanguageDetect
|
class Text_LanguageDetect
|
||||||
{
|
{
|
||||||
@ -74,9 +70,8 @@ class Text_LanguageDetect
|
|||||||
* $this->_data_dir will be ignored
|
* $this->_data_dir will be ignored
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
var $_db_filename = 'lang.dat';
|
protected $_db_filename = 'lang.dat';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The filename that stores the unicode block definitions
|
* The filename that stores the unicode block definitions
|
||||||
@ -85,9 +80,8 @@ class Text_LanguageDetect
|
|||||||
* $this->_data_dir will be ignored
|
* $this->_data_dir will be ignored
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
var $_unicode_db_filename = 'unicode_blocks.dat';
|
protected $_unicode_db_filename = 'unicode_blocks.dat';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The data directory
|
* The data directory
|
||||||
@ -95,9 +89,8 @@ class Text_LanguageDetect
|
|||||||
* Should be set by PEAR installer
|
* Should be set by PEAR installer
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
var $_data_dir = '@data_dir@';
|
protected $_data_dir = '@data_dir@';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The trigram data for comparison
|
* The trigram data for comparison
|
||||||
@ -105,63 +98,56 @@ class Text_LanguageDetect
|
|||||||
* Will be loaded on start from $this->_db_filename
|
* Will be loaded on start from $this->_db_filename
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
var $_lang_db = array();
|
protected $_lang_db = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the map of the trigram data to unicode characters
|
* Stores the map of the trigram data to unicode characters
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_unicode_map;
|
protected $_unicode_map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The size of the trigram data arrays
|
* The size of the trigram data arrays
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
var $_threshold = 300;
|
protected $_threshold = 300;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the maximum possible score.
|
* The maximum possible score.
|
||||||
*
|
*
|
||||||
* needed for score normalization. Different depending on the
|
* Needed for score normalization. Different depending on the
|
||||||
* perl compatibility setting
|
* perl compatibility setting
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var int
|
* @var int
|
||||||
* @see setPerlCompatible()
|
* @see setPerlCompatible()
|
||||||
*/
|
*/
|
||||||
var $_max_score = 0;
|
protected $_max_score = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not to simulate perl's Language::Guess exactly
|
* Whether or not to simulate perl's Language::Guess exactly
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
* @see setPerlCompatible()
|
* @see setPerlCompatible()
|
||||||
*/
|
*/
|
||||||
var $_perl_compatible = false;
|
protected $_perl_compatible = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use the unicode block detection to speed up processing
|
* Whether to use the unicode block detection to speed up processing
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $_use_unicode_narrowing = true;
|
protected $_use_unicode_narrowing = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the result of the clustering operation
|
* Stores the result of the clustering operation
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var array
|
* @var array
|
||||||
* @see clusterLanguages()
|
* @see clusterLanguages()
|
||||||
*/
|
*/
|
||||||
var $_clusters;
|
protected $_clusters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which type of "language names" are accepted and returned:
|
* Which type of "language names" are accepted and returned:
|
||||||
@ -170,7 +156,7 @@ class Text_LanguageDetect
|
|||||||
* 2 - 2-letter ISO 639-1 code ("en")
|
* 2 - 2-letter ISO 639-1 code ("en")
|
||||||
* 3 - 3-letter ISO 639-2 code ("eng")
|
* 3 - 3-letter ISO 639-2 code ("eng")
|
||||||
*/
|
*/
|
||||||
var $_name_mode = 0;
|
protected $_name_mode = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@ -178,7 +164,7 @@ class Text_LanguageDetect
|
|||||||
* Will attempt to load the language database. If it fails, you will get
|
* Will attempt to load the language database. If it fails, you will get
|
||||||
* an exception.
|
* an exception.
|
||||||
*/
|
*/
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$data = $this->_readdb($this->_db_filename);
|
$data = $this->_readdb($this->_db_filename);
|
||||||
$this->_checkTrigram($data['trigram']);
|
$this->_checkTrigram($data['trigram']);
|
||||||
@ -200,9 +186,8 @@ class Text_LanguageDetect
|
|||||||
* @param string $fname File name to load
|
* @param string $fname File name to load
|
||||||
*
|
*
|
||||||
* @return string expected path to the language model database
|
* @return string expected path to the language model database
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _get_data_loc($fname)
|
protected function _get_data_loc($fname)
|
||||||
{
|
{
|
||||||
if ($fname{0} == '/' || $fname{0} == '.') {
|
if ($fname{0} == '/' || $fname{0} == '.') {
|
||||||
// if filename starts with a slash, assume it's an absolute pathname
|
// if filename starts with a slash, assume it's an absolute pathname
|
||||||
@ -229,9 +214,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return array the language model data
|
* @return array the language model data
|
||||||
* @throws Text_LanguageDetect_Exception
|
* @throws Text_LanguageDetect_Exception
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _readdb($fname)
|
protected function _readdb($fname)
|
||||||
{
|
{
|
||||||
// finds the correct data dir
|
// finds the correct data dir
|
||||||
$fname = $this->_get_data_loc($fname);
|
$fname = $this->_get_data_loc($fname);
|
||||||
@ -259,9 +243,8 @@ class Text_LanguageDetect
|
|||||||
* @param array $trigram Trigram data from database
|
* @param array $trigram Trigram data from database
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _checkTrigram($trigram)
|
protected function _checkTrigram($trigram)
|
||||||
{
|
{
|
||||||
if (!is_array($trigram)) {
|
if (!is_array($trigram)) {
|
||||||
if (ini_get('magic_quotes_runtime')) {
|
if (ini_get('magic_quotes_runtime')) {
|
||||||
@ -353,11 +336,10 @@ class Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Returns the number of languages that this object can detect
|
* Returns the number of languages that this object can detect
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @return int the number of languages
|
* @return int the number of languages
|
||||||
* @throws Text_LanguageDetect_Exception
|
* @throws Text_LanguageDetect_Exception
|
||||||
*/
|
*/
|
||||||
function getLanguageCount()
|
public function getLanguageCount()
|
||||||
{
|
{
|
||||||
return count($this->_lang_db);
|
return count($this->_lang_db);
|
||||||
}
|
}
|
||||||
@ -395,11 +377,10 @@ class Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Returns the list of detectable languages
|
* Returns the list of detectable languages
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @return array the names of the languages known to this object<<<<<<<
|
* @return array the names of the languages known to this object<<<<<<<
|
||||||
* @throws Text_LanguageDetect_Exception
|
* @throws Text_LanguageDetect_Exception
|
||||||
*/
|
*/
|
||||||
function getLanguages()
|
public function getLanguages()
|
||||||
{
|
{
|
||||||
return $this->_convertToNameMode(
|
return $this->_convertToNameMode(
|
||||||
array_keys($this->_lang_db)
|
array_keys($this->_lang_db)
|
||||||
@ -437,7 +418,7 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setNameMode($name_mode)
|
public function setNameMode($name_mode)
|
||||||
{
|
{
|
||||||
$this->_name_mode = $name_mode;
|
$this->_name_mode = $name_mode;
|
||||||
}
|
}
|
||||||
@ -467,10 +448,9 @@ class Text_LanguageDetect
|
|||||||
* @param string $text text to convert
|
* @param string $text text to convert
|
||||||
*
|
*
|
||||||
* @return array array of trigram frequencies
|
* @return array array of trigram frequencies
|
||||||
* @access private
|
|
||||||
* @deprecated Superceded by the Text_LanguageDetect_Parser class
|
* @deprecated Superceded by the Text_LanguageDetect_Parser class
|
||||||
*/
|
*/
|
||||||
function _trigram($text)
|
protected function _trigram($text)
|
||||||
{
|
{
|
||||||
$s = new Text_LanguageDetect_Parser($text);
|
$s = new Text_LanguageDetect_Parser($text);
|
||||||
$s->prepareTrigram();
|
$s->prepareTrigram();
|
||||||
@ -488,9 +468,8 @@ class Text_LanguageDetect
|
|||||||
* @param array $arr array of trigram
|
* @param array $arr array of trigram
|
||||||
*
|
*
|
||||||
* @return array ranks of trigrams
|
* @return array ranks of trigrams
|
||||||
* @access protected
|
|
||||||
*/
|
*/
|
||||||
function _arr_rank($arr)
|
protected function _arr_rank($arr)
|
||||||
{
|
{
|
||||||
|
|
||||||
// sorts alphabetically first as a standard way of breaking rank ties
|
// sorts alphabetically first as a standard way of breaking rank ties
|
||||||
@ -518,12 +497,11 @@ class Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Sorts an array by value breaking ties alphabetically
|
* Sorts an array by value breaking ties alphabetically
|
||||||
*
|
*
|
||||||
* @param array &$arr the array to sort
|
* @param array $arr the array to sort
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _bub_sort(&$arr)
|
protected function _bub_sort(&$arr)
|
||||||
{
|
{
|
||||||
// should do the same as this perl statement:
|
// should do the same as this perl statement:
|
||||||
// sort { $trigrams{$b} == $trigrams{$a}
|
// sort { $trigrams{$b} == $trigrams{$a}
|
||||||
@ -561,9 +539,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return int 1 if $a is greater, -1 if not
|
* @return int 1 if $a is greater, -1 if not
|
||||||
* @see _bub_sort()
|
* @see _bub_sort()
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _sort_func($a, $b)
|
protected function _sort_func($a, $b)
|
||||||
{
|
{
|
||||||
// each is actually a key/value pair, so that it can compare using both
|
// each is actually a key/value pair, so that it can compare using both
|
||||||
list($a_key, $a_value) = $a;
|
list($a_key, $a_value) = $a;
|
||||||
@ -601,9 +578,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return int the sum of the differences between the ranks of
|
* @return int the sum of the differences between the ranks of
|
||||||
* the two trigram sets
|
* the two trigram sets
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _distance($arr1, $arr2)
|
protected function _distance($arr1, $arr2)
|
||||||
{
|
{
|
||||||
$sumdist = 0;
|
$sumdist = 0;
|
||||||
|
|
||||||
@ -634,9 +610,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return float the normalized score
|
* @return float the normalized score
|
||||||
* @see _distance()
|
* @see _distance()
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
function _normalize_score($score, $base_count = null)
|
protected function _normalize_score($score, $base_count = null)
|
||||||
{
|
{
|
||||||
if ($base_count === null) {
|
if ($base_count === null) {
|
||||||
$base_count = $this->_threshold;
|
$base_count = $this->_threshold;
|
||||||
@ -712,7 +687,7 @@ class Text_LanguageDetect
|
|||||||
$sample_obj->setPadStart(!$this->_perl_compatible);
|
$sample_obj->setPadStart(!$this->_perl_compatible);
|
||||||
$sample_obj->analyze();
|
$sample_obj->analyze();
|
||||||
|
|
||||||
$trigram_freqs =& $sample_obj->getTrigramRanks();
|
$trigram_freqs = $sample_obj->getTrigramRanks();
|
||||||
$trigram_count = count($trigram_freqs);
|
$trigram_count = count($trigram_freqs);
|
||||||
|
|
||||||
if ($trigram_count == 0) {
|
if ($trigram_count == 0) {
|
||||||
@ -723,7 +698,7 @@ class Text_LanguageDetect
|
|||||||
|
|
||||||
// use unicode block detection to narrow down the possibilities
|
// use unicode block detection to narrow down the possibilities
|
||||||
if ($this->_use_unicode_narrowing) {
|
if ($this->_use_unicode_narrowing) {
|
||||||
$blocks =& $sample_obj->getUnicodeBlocks();
|
$blocks = $sample_obj->getUnicodeBlocks();
|
||||||
|
|
||||||
if (is_array($blocks)) {
|
if (is_array($blocks)) {
|
||||||
$present_blocks = array_keys($blocks);
|
$present_blocks = array_keys($blocks);
|
||||||
@ -975,9 +950,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return mixed Block name, -1 if it failed
|
* @return mixed Block name, -1 if it failed
|
||||||
* @see unicodeBlockName()
|
* @see unicodeBlockName()
|
||||||
* @access protected
|
|
||||||
*/
|
*/
|
||||||
function _unicode_block_name($unicode, $blocks, $block_count = -1)
|
protected function _unicode_block_name($unicode, $blocks, $block_count = -1)
|
||||||
{
|
{
|
||||||
// for a reference, see
|
// for a reference, see
|
||||||
// http://www.unicode.org/Public/UNIDATA/Blocks.txt
|
// http://www.unicode.org/Public/UNIDATA/Blocks.txt
|
||||||
@ -1028,9 +1002,8 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return array the database of unicode block definitions
|
* @return array the database of unicode block definitions
|
||||||
* @throws Text_LanguageDetect_Exception
|
* @throws Text_LanguageDetect_Exception
|
||||||
* @access protected
|
|
||||||
*/
|
*/
|
||||||
function _read_unicode_block_db()
|
protected function _read_unicode_block_db()
|
||||||
{
|
{
|
||||||
// since the unicode definitions are always going to be the same,
|
// since the unicode definitions are always going to be the same,
|
||||||
// might as well share the memory for the db with all other instances
|
// might as well share the memory for the db with all other instances
|
||||||
@ -1149,14 +1122,13 @@ class Text_LanguageDetect
|
|||||||
* Uses a nearest neighbor technique to generate the maximum possible
|
* Uses a nearest neighbor technique to generate the maximum possible
|
||||||
* number of dendograms from the similarity data.
|
* number of dendograms from the similarity data.
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @return array language cluster data
|
* @return array language cluster data
|
||||||
* @throws Text_LanguageDetect_Exception
|
* @throws Text_LanguageDetect_Exception
|
||||||
* @see languageSimilarity()
|
* @see languageSimilarity()
|
||||||
* @deprecated this function will eventually be removed and placed into
|
* @deprecated this function will eventually be removed and placed into
|
||||||
* the model generation class
|
* the model generation class
|
||||||
*/
|
*/
|
||||||
function clusterLanguages()
|
public function clusterLanguages()
|
||||||
{
|
{
|
||||||
// todo: set the maximum number of clusters
|
// todo: set the maximum number of clusters
|
||||||
// return cached result, if any
|
// return cached result, if any
|
||||||
@ -1465,7 +1437,7 @@ class Text_LanguageDetect
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ut8-safe strlen()
|
* UTF8-safe strlen()
|
||||||
*
|
*
|
||||||
* Returns the numbers of characters (not bytes) in a utf8 string
|
* Returns the numbers of characters (not bytes) in a utf8 string
|
||||||
*
|
*
|
||||||
@ -1489,10 +1461,9 @@ class Text_LanguageDetect
|
|||||||
* @param string $char a utf8 (possibly multi-byte) char
|
* @param string $char a utf8 (possibly multi-byte) char
|
||||||
*
|
*
|
||||||
* @return int unicode value
|
* @return int unicode value
|
||||||
* @access protected
|
|
||||||
* @link http://en.wikipedia.org/wiki/UTF-8
|
* @link http://en.wikipedia.org/wiki/UTF-8
|
||||||
*/
|
*/
|
||||||
function _utf8char2unicode($char)
|
protected function _utf8char2unicode($char)
|
||||||
{
|
{
|
||||||
// strlen() here will actually get the binary length of a single char
|
// strlen() here will actually get the binary length of a single char
|
||||||
switch (strlen($char)) {
|
switch (strlen($char)) {
|
||||||
@ -1529,20 +1500,19 @@ class Text_LanguageDetect
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* utf8-safe fast character iterator
|
* UTF8-safe fast character iterator
|
||||||
*
|
*
|
||||||
* Will get the next character starting from $counter, which will then be
|
* Will get the next character starting from $counter, which will then be
|
||||||
* incremented. If a multi-byte char the bytes will be concatenated and
|
* incremented. If a multi-byte char the bytes will be concatenated and
|
||||||
* $counter will be incremeted by the number of bytes in the char.
|
* $counter will be incremeted by the number of bytes in the char.
|
||||||
*
|
*
|
||||||
* @param string $str the string being iterated over
|
* @param string $str the string being iterated over
|
||||||
* @param int &$counter the iterator, will increment by reference
|
* @param int $counter the iterator, will increment by reference
|
||||||
* @param bool $special_convert whether to do special conversions
|
* @param bool $special_convert whether to do special conversions
|
||||||
*
|
*
|
||||||
* @return char the next (possibly multi-byte) char from $counter
|
* @return char the next (possibly multi-byte) char from $counter
|
||||||
* @access private
|
|
||||||
*/
|
*/
|
||||||
static function _next_char($str, &$counter, $special_convert = false)
|
protected static function _next_char($str, &$counter, $special_convert = false)
|
||||||
{
|
{
|
||||||
$char = $str{$counter++};
|
$char = $str{$counter++};
|
||||||
$ord = ord($char);
|
$ord = ord($char);
|
||||||
@ -1634,7 +1604,7 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return string|array Language name
|
* @return string|array Language name
|
||||||
*/
|
*/
|
||||||
function _convertFromNameMode($lang, $convertKey = false)
|
protected function _convertFromNameMode($lang, $convertKey = false)
|
||||||
{
|
{
|
||||||
if ($this->_name_mode == 0) {
|
if ($this->_name_mode == 0) {
|
||||||
return $lang;
|
return $lang;
|
||||||
@ -1674,7 +1644,7 @@ class Text_LanguageDetect
|
|||||||
*
|
*
|
||||||
* @return string|array Language name
|
* @return string|array Language name
|
||||||
*/
|
*/
|
||||||
function _convertToNameMode($lang, $convertKey = false)
|
protected function _convertToNameMode($lang, $convertKey = false)
|
||||||
{
|
{
|
||||||
if ($this->_name_mode == 0) {
|
if ($this->_name_mode == 0) {
|
||||||
return $lang;
|
return $lang;
|
@ -1,4 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Part of Text_LanguageDetect
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Text
|
||||||
|
* @package Text_LanguageDetect
|
||||||
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Part of the PEAR language detection package
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
|
*
|
||||||
|
* @category Text
|
||||||
|
* @package Text_LanguageDetect
|
||||||
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
|
* @link http://langdetect.blogspot.com/
|
||||||
|
*/
|
||||||
class Text_LanguageDetect_Exception extends Exception
|
class Text_LanguageDetect_Exception extends Exception
|
||||||
{
|
{
|
||||||
/**
|
/**
|
@ -9,7 +9,6 @@
|
|||||||
* @author Christian Weiske <cweiske@php.net>
|
* @author Christian Weiske <cweiske@php.net>
|
||||||
* @copyright 2011 Christian Weiske <cweiske@php.net>
|
* @copyright 2011 Christian Weiske <cweiske@php.net>
|
||||||
* @license http://www.debian.org/misc/bsd.license BSD
|
* @license http://www.debian.org/misc/bsd.license BSD
|
||||||
* @version SVN: $Id$
|
|
||||||
* @link http://pear.php.net/package/Text_LanguageDetect/
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -23,7 +22,7 @@
|
|||||||
* @package Text_LanguageDetect
|
* @package Text_LanguageDetect
|
||||||
* @author Christian Weiske <cweiske@php.net>
|
* @author Christian Weiske <cweiske@php.net>
|
||||||
* @copyright 2011 Christian Weiske <cweiske@php.net>
|
* @copyright 2011 Christian Weiske <cweiske@php.net>
|
||||||
* @license http://www.debian.org/misc/bsd.license BSD
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
* @link http://www.loc.gov/standards/iso639-2/php/code_list.php
|
* @link http://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||||
*/
|
*/
|
||||||
class Text_LanguageDetect_ISO639
|
class Text_LanguageDetect_ISO639
|
@ -1,16 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a text sample to be parsed.
|
* Part of Text_LanguageDetect
|
||||||
|
*
|
||||||
|
* PHP version 5
|
||||||
*
|
*
|
||||||
* @category Text
|
* @category Text
|
||||||
* @package Text_LanguageDetect
|
* @package Text_LanguageDetect
|
||||||
* @author Nicholas Pisarro
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
* @copyright 2006
|
* @copyright 2006 Nicholas Pisarro
|
||||||
* @license BSD
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
* @version CVS: $Id: Parser.php 322327 2012-01-15 17:55:59Z cweiske $
|
|
||||||
* @link http://pear.php.net/package/Text_LanguageDetect/
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
* @link http://langdetect.blogspot.com/
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,94 +24,101 @@
|
|||||||
*
|
*
|
||||||
* @category Text
|
* @category Text
|
||||||
* @package Text_LanguageDetect
|
* @package Text_LanguageDetect
|
||||||
* @author Nicholas Pisarro
|
* @author Nicholas Pisarro <infinityminusnine+pear@gmail.com>
|
||||||
* @copyright 2006
|
* @copyright 2006 Nicholas Pisarro
|
||||||
* @license BSD
|
* @license BSD http://www.opensource.org/licenses/bsd-license.php
|
||||||
* @version release: 0.3.0
|
* @version Release: @package_version@
|
||||||
|
* @link http://pear.php.net/package/Text_LanguageDetect/
|
||||||
*/
|
*/
|
||||||
class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* the piece of text being parsed
|
* The piece of text being parsed
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_string;
|
protected $_string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the trigram frequencies of the sample
|
* Stores the trigram frequencies of the sample
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_trigrams = array();
|
protected $_trigrams = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the trigram ranks of the sample
|
* Stores the trigram ranks of the sample
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_trigram_ranks = array();
|
protected $_trigram_ranks = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stores the unicode blocks of the sample
|
* Stores the unicode blocks of the sample
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $_unicode_blocks = array();
|
protected $_unicode_blocks = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the parser should compile the unicode ranges
|
* Whether the parser should compile the unicode ranges
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $_compile_unicode = false;
|
protected $_compile_unicode = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the parser should compile trigrams
|
* Whether the parser should compile trigrams
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $_compile_trigram = false;
|
protected $_compile_trigram = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the trigram parser should pad the beginning of the string
|
* Whether the trigram parser should pad the beginning of the string
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $_trigram_pad_start = false;
|
protected $_trigram_pad_start = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the unicode parser should skip non-alphabetical ascii chars
|
* Whether the unicode parser should skip non-alphabetical ascii chars
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
var $_unicode_skip_symbols = true;
|
protected $_unicode_skip_symbols = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @access private
|
|
||||||
* @param string $string string to be parsed
|
* @param string $string string to be parsed
|
||||||
*/
|
*/
|
||||||
function Text_LanguageDetect_Parser($string) {
|
public function __construct($string)
|
||||||
|
{
|
||||||
$this->_string = $string;
|
$this->_string = $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP 4 constructor for backwards compatibility.
|
||||||
|
*
|
||||||
|
* @param string $string string to be parsed
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function Text_LanguageDetect_Parser($string)
|
||||||
|
{
|
||||||
|
self::__construct($string);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if a string is suitable for parsing
|
* Returns true if a string is suitable for parsing
|
||||||
*
|
*
|
||||||
* @param string $str input string to test
|
* @param string $str input string to test
|
||||||
|
*
|
||||||
* @return bool true if acceptable, false if not
|
* @return bool true if acceptable, false if not
|
||||||
*/
|
*/
|
||||||
public static function validateString($str) {
|
public static function validateString($str)
|
||||||
|
{
|
||||||
if (!empty($str) && strlen($str) > 3 && preg_match('/\S/', $str)) {
|
if (!empty($str) && strlen($str) > 3 && preg_match('/\S/', $str)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -121,34 +127,37 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* turn on/off trigram counting
|
* Turn on/off trigram counting
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @param bool $bool true for on, false for off
|
* @param bool $bool true for on, false for off
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function prepareTrigram($bool = true)
|
public function prepareTrigram($bool = true)
|
||||||
{
|
{
|
||||||
$this->_compile_trigram = $bool;
|
$this->_compile_trigram = $bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* turn on/off unicode block counting
|
* Turn on/off unicode block counting
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @param bool $bool true for on, false for off
|
* @param bool $bool true for on, false for off
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function prepareUnicode($bool = true)
|
public function prepareUnicode($bool = true)
|
||||||
{
|
{
|
||||||
$this->_compile_unicode = $bool;
|
$this->_compile_unicode = $bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* turn on/off padding the beginning of the sample string
|
* Turn on/off padding the beginning of the sample string
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @param bool $bool true for on, false for off
|
* @param bool $bool true for on, false for off
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setPadStart($bool = true)
|
public function setPadStart($bool = true)
|
||||||
{
|
{
|
||||||
$this->_trigram_pad_start = $bool;
|
$this->_trigram_pad_start = $bool;
|
||||||
}
|
}
|
||||||
@ -156,10 +165,11 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Should the unicode block counter skip non-alphabetical ascii chars?
|
* Should the unicode block counter skip non-alphabetical ascii chars?
|
||||||
*
|
*
|
||||||
* @access public
|
|
||||||
* @param bool $bool true for on, false for off
|
* @param bool $bool true for on, false for off
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function setUnicodeSkipSymbols($bool = true)
|
public function setUnicodeSkipSymbols($bool = true)
|
||||||
{
|
{
|
||||||
$this->_unicode_skip_symbols = $bool;
|
$this->_unicode_skip_symbols = $bool;
|
||||||
}
|
}
|
||||||
@ -167,10 +177,9 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Returns the trigram ranks for the text sample
|
* Returns the trigram ranks for the text sample
|
||||||
*
|
*
|
||||||
* @access public
|
* @return array Trigram ranks in the text sample
|
||||||
* @return array trigram ranks in the text sample
|
|
||||||
*/
|
*/
|
||||||
function &getTrigramRanks()
|
public function getTrigramRanks()
|
||||||
{
|
{
|
||||||
return $this->_trigram_ranks;
|
return $this->_trigram_ranks;
|
||||||
}
|
}
|
||||||
@ -178,23 +187,21 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
/**
|
/**
|
||||||
* Return the trigram freqency table
|
* Return the trigram freqency table
|
||||||
*
|
*
|
||||||
* only used in testing to make sure the parser is working
|
* Only used in testing to make sure the parser is working
|
||||||
*
|
*
|
||||||
* @access public
|
* @return array Trigram freqencies in the text sample
|
||||||
* @return array trigram freqencies in the text sample
|
|
||||||
*/
|
*/
|
||||||
function &getTrigramFreqs()
|
public function getTrigramFreqs()
|
||||||
{
|
{
|
||||||
return $this->_trigram;
|
return $this->_trigram;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the array of unicode blocks
|
* Returns the array of unicode blocks
|
||||||
*
|
*
|
||||||
* @access public
|
* @return array Unicode blocks in the text sample
|
||||||
* @return array unicode blocks in the text sample
|
|
||||||
*/
|
*/
|
||||||
function &getUnicodeBlocks()
|
public function getUnicodeBlocks()
|
||||||
{
|
{
|
||||||
return $this->_unicode_blocks;
|
return $this->_unicode_blocks;
|
||||||
}
|
}
|
||||||
@ -208,9 +215,9 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
* Afterwards the get*() functions can be used to access the compiled
|
* Afterwards the get*() functions can be used to access the compiled
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* @access public
|
* @return void
|
||||||
*/
|
*/
|
||||||
function analyze()
|
public function analyze()
|
||||||
{
|
{
|
||||||
$len = strlen($this->_string);
|
$len = strlen($this->_string);
|
||||||
$byte_counter = 0;
|
$byte_counter = 0;
|
||||||
@ -274,7 +281,8 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
&& strlen($char) == 1
|
&& strlen($char) == 1
|
||||||
&& ($char < 'A' || $char > 'z'
|
&& ($char < 'A' || $char > 'z'
|
||||||
|| ($char > 'Z' && $char < 'a'))
|
|| ($char > 'Z' && $char < 'a'))
|
||||||
&& $char != "'") { // does not skip the apostrophe
|
&& $char != "'"
|
||||||
|
) { // does not skip the apostrophe
|
||||||
// since it's included in the language
|
// since it's included in the language
|
||||||
// models
|
// models
|
||||||
|
|
||||||
@ -297,7 +305,8 @@ class Text_LanguageDetect_Parser extends Text_LanguageDetect
|
|||||||
if ($this->_compile_unicode) {
|
if ($this->_compile_unicode) {
|
||||||
foreach ($unicode_chars as $utf8_char => $count) {
|
foreach ($unicode_chars as $utf8_char => $count) {
|
||||||
$search_result = $this->_unicode_block_name(
|
$search_result = $this->_unicode_block_name(
|
||||||
$this->_utf8char2unicode($utf8_char), $blocks, $block_count);
|
$this->_utf8char2unicode($utf8_char), $blocks, $block_count
|
||||||
|
);
|
||||||
|
|
||||||
if ($search_result != -1) {
|
if ($search_result != -1) {
|
||||||
$block_name = $search_result[2];
|
$block_name = $search_result[2];
|
32
vendor/pear/text_languagedetect/composer.json
vendored
Normal file
32
vendor/pear/text_languagedetect/composer.json
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "pear/text_languagedetect",
|
||||||
|
"description": "Identify human languages from text samples",
|
||||||
|
"homepage": "http://pear.php.net/package/Text_LanguageDetect",
|
||||||
|
"type": "library",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"support": {
|
||||||
|
"issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Text_LanguageDetect",
|
||||||
|
"source": "https://github.com/pear/Text_LanguageDetect"
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"email": "taak@php.net",
|
||||||
|
"name": "Nicholas Pisarro",
|
||||||
|
"role": "Lead"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Text": "./"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include-path": [
|
||||||
|
"./"
|
||||||
|
],
|
||||||
|
"suggest": {
|
||||||
|
"ext-mbstring": "May require the mbstring PHP extension"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "*"
|
||||||
|
}
|
||||||
|
}
|
7
vendor/pear/text_languagedetect/data/build-unicode_blocks.php
vendored
Normal file
7
vendor/pear/text_languagedetect/data/build-unicode_blocks.php
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Generate the serialized unicode_blocks.dat file shipped with the package
|
||||||
|
*/
|
||||||
|
$unicode_blocks = include __DIR__ . '/unicode_blocks.php';
|
||||||
|
file_put_contents(__DIR__ . '/unicode_blocks.dat', serialize($unicode_blocks));
|
||||||
|
?>
|
1
vendor/pear/text_languagedetect/data/unicode_blocks.dat
vendored
Normal file
1
vendor/pear/text_languagedetect/data/unicode_blocks.dat
vendored
Normal file
File diff suppressed because one or more lines are too long
874
vendor/pear/text_languagedetect/data/unicode_blocks.php
vendored
Normal file
874
vendor/pear/text_languagedetect/data/unicode_blocks.php
vendored
Normal file
@ -0,0 +1,874 @@
|
|||||||
|
<?php
|
||||||
|
return array (
|
||||||
|
0 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0000,
|
||||||
|
1 => 0x007F,
|
||||||
|
2 => 'Basic Latin',
|
||||||
|
),
|
||||||
|
1 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0080,
|
||||||
|
1 => 0x00FF,
|
||||||
|
2 => 'Latin-1 Supplement',
|
||||||
|
),
|
||||||
|
2 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0100,
|
||||||
|
1 => 0x017F,
|
||||||
|
2 => 'Latin Extended-A',
|
||||||
|
),
|
||||||
|
3 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0180,
|
||||||
|
1 => 0x024F,
|
||||||
|
2 => 'Latin Extended-B',
|
||||||
|
),
|
||||||
|
4 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0250,
|
||||||
|
1 => 0x02AF,
|
||||||
|
2 => 'IPA Extensions',
|
||||||
|
),
|
||||||
|
5 =>
|
||||||
|
array (
|
||||||
|
0 => 0x02B0,
|
||||||
|
1 => 0x02FF,
|
||||||
|
2 => 'Spacing Modifier Letters',
|
||||||
|
),
|
||||||
|
6 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0300,
|
||||||
|
1 => 0x036F,
|
||||||
|
2 => 'Combining Diacritical Marks',
|
||||||
|
),
|
||||||
|
7 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0370,
|
||||||
|
1 => 0x03FF,
|
||||||
|
2 => 'Greek and Coptic',
|
||||||
|
),
|
||||||
|
8 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0400,
|
||||||
|
1 => 0x04FF,
|
||||||
|
2 => 'Cyrillic',
|
||||||
|
),
|
||||||
|
9 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0500,
|
||||||
|
1 => 0x052F,
|
||||||
|
2 => 'Cyrillic Supplement',
|
||||||
|
),
|
||||||
|
10 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0530,
|
||||||
|
1 => 0x058F,
|
||||||
|
2 => 'Armenian',
|
||||||
|
),
|
||||||
|
11 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0590,
|
||||||
|
1 => 0x05FF,
|
||||||
|
2 => 'Hebrew',
|
||||||
|
),
|
||||||
|
12 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0600,
|
||||||
|
1 => 0x06FF,
|
||||||
|
2 => 'Arabic',
|
||||||
|
),
|
||||||
|
13 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0700,
|
||||||
|
1 => 0x074F,
|
||||||
|
2 => 'Syriac',
|
||||||
|
),
|
||||||
|
14 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0750,
|
||||||
|
1 => 0x077F,
|
||||||
|
2 => 'Arabic Supplement',
|
||||||
|
),
|
||||||
|
15 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0780,
|
||||||
|
1 => 0x07BF,
|
||||||
|
2 => 'Thaana',
|
||||||
|
),
|
||||||
|
16 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0900,
|
||||||
|
1 => 0x097F,
|
||||||
|
2 => 'Devanagari',
|
||||||
|
),
|
||||||
|
17 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0980,
|
||||||
|
1 => 0x09FF,
|
||||||
|
2 => 'Bengali',
|
||||||
|
),
|
||||||
|
18 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0A00,
|
||||||
|
1 => 0x0A7F,
|
||||||
|
2 => 'Gurmukhi',
|
||||||
|
),
|
||||||
|
19 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0A80,
|
||||||
|
1 => 0x0AFF,
|
||||||
|
2 => 'Gujarati',
|
||||||
|
),
|
||||||
|
20 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0B00,
|
||||||
|
1 => 0x0B7F,
|
||||||
|
2 => 'Oriya',
|
||||||
|
),
|
||||||
|
21 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0B80,
|
||||||
|
1 => 0x0BFF,
|
||||||
|
2 => 'Tamil',
|
||||||
|
),
|
||||||
|
22 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0C00,
|
||||||
|
1 => 0x0C7F,
|
||||||
|
2 => 'Telugu',
|
||||||
|
),
|
||||||
|
23 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0C80,
|
||||||
|
1 => 0x0CFF,
|
||||||
|
2 => 'Kannada',
|
||||||
|
),
|
||||||
|
24 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0D00,
|
||||||
|
1 => 0x0D7F,
|
||||||
|
2 => 'Malayalam',
|
||||||
|
),
|
||||||
|
25 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0D80,
|
||||||
|
1 => 0x0DFF,
|
||||||
|
2 => 'Sinhala',
|
||||||
|
),
|
||||||
|
26 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0E00,
|
||||||
|
1 => 0x0E7F,
|
||||||
|
2 => 'Thai',
|
||||||
|
),
|
||||||
|
27 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0E80,
|
||||||
|
1 => 0x0EFF,
|
||||||
|
2 => 'Lao',
|
||||||
|
),
|
||||||
|
28 =>
|
||||||
|
array (
|
||||||
|
0 => 0x0F00,
|
||||||
|
1 => 0x0FFF,
|
||||||
|
2 => 'Tibetan',
|
||||||
|
),
|
||||||
|
29 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1000,
|
||||||
|
1 => 0x109F,
|
||||||
|
2 => 'Myanmar',
|
||||||
|
),
|
||||||
|
30 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10A0,
|
||||||
|
1 => 0x10FF,
|
||||||
|
2 => 'Georgian',
|
||||||
|
),
|
||||||
|
31 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1100,
|
||||||
|
1 => 0x11FF,
|
||||||
|
2 => 'Hangul Jamo',
|
||||||
|
),
|
||||||
|
32 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1200,
|
||||||
|
1 => 0x137F,
|
||||||
|
2 => 'Ethiopic',
|
||||||
|
),
|
||||||
|
33 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1380,
|
||||||
|
1 => 0x139F,
|
||||||
|
2 => 'Ethiopic Supplement',
|
||||||
|
),
|
||||||
|
34 =>
|
||||||
|
array (
|
||||||
|
0 => 0x13A0,
|
||||||
|
1 => 0x13FF,
|
||||||
|
2 => 'Cherokee',
|
||||||
|
),
|
||||||
|
35 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1400,
|
||||||
|
1 => 0x167F,
|
||||||
|
2 => 'Unified Canadian Aboriginal Syllabics',
|
||||||
|
),
|
||||||
|
36 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1680,
|
||||||
|
1 => 0x169F,
|
||||||
|
2 => 'Ogham',
|
||||||
|
),
|
||||||
|
37 =>
|
||||||
|
array (
|
||||||
|
0 => 0x16A0,
|
||||||
|
1 => 0x16FF,
|
||||||
|
2 => 'Runic',
|
||||||
|
),
|
||||||
|
38 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1700,
|
||||||
|
1 => 0x171F,
|
||||||
|
2 => 'Tagalog',
|
||||||
|
),
|
||||||
|
39 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1720,
|
||||||
|
1 => 0x173F,
|
||||||
|
2 => 'Hanunoo',
|
||||||
|
),
|
||||||
|
40 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1740,
|
||||||
|
1 => 0x175F,
|
||||||
|
2 => 'Buhid',
|
||||||
|
),
|
||||||
|
41 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1760,
|
||||||
|
1 => 0x177F,
|
||||||
|
2 => 'Tagbanwa',
|
||||||
|
),
|
||||||
|
42 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1780,
|
||||||
|
1 => 0x17FF,
|
||||||
|
2 => 'Khmer',
|
||||||
|
),
|
||||||
|
43 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1800,
|
||||||
|
1 => 0x18AF,
|
||||||
|
2 => 'Mongolian',
|
||||||
|
),
|
||||||
|
44 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1900,
|
||||||
|
1 => 0x194F,
|
||||||
|
2 => 'Limbu',
|
||||||
|
),
|
||||||
|
45 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1950,
|
||||||
|
1 => 0x197F,
|
||||||
|
2 => 'Tai Le',
|
||||||
|
),
|
||||||
|
46 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1980,
|
||||||
|
1 => 0x19DF,
|
||||||
|
2 => 'New Tai Lue',
|
||||||
|
),
|
||||||
|
47 =>
|
||||||
|
array (
|
||||||
|
0 => 0x19E0,
|
||||||
|
1 => 0x19FF,
|
||||||
|
2 => 'Khmer Symbols',
|
||||||
|
),
|
||||||
|
48 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1A00,
|
||||||
|
1 => 0x1A1F,
|
||||||
|
2 => 'Buginese',
|
||||||
|
),
|
||||||
|
49 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D00,
|
||||||
|
1 => 0x1D7F,
|
||||||
|
2 => 'Phonetic Extensions',
|
||||||
|
),
|
||||||
|
50 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D80,
|
||||||
|
1 => 0x1DBF,
|
||||||
|
2 => 'Phonetic Extensions Supplement',
|
||||||
|
),
|
||||||
|
51 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1DC0,
|
||||||
|
1 => 0x1DFF,
|
||||||
|
2 => 'Combining Diacritical Marks Supplement',
|
||||||
|
),
|
||||||
|
52 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1E00,
|
||||||
|
1 => 0x1EFF,
|
||||||
|
2 => 'Latin Extended Additional',
|
||||||
|
),
|
||||||
|
53 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1F00,
|
||||||
|
1 => 0x1FFF,
|
||||||
|
2 => 'Greek Extended',
|
||||||
|
),
|
||||||
|
54 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2000,
|
||||||
|
1 => 0x206F,
|
||||||
|
2 => 'General Punctuation',
|
||||||
|
),
|
||||||
|
55 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2070,
|
||||||
|
1 => 0x209F,
|
||||||
|
2 => 'Superscripts and Subscripts',
|
||||||
|
),
|
||||||
|
56 =>
|
||||||
|
array (
|
||||||
|
0 => 0x20A0,
|
||||||
|
1 => 0x20CF,
|
||||||
|
2 => 'Currency Symbols',
|
||||||
|
),
|
||||||
|
57 =>
|
||||||
|
array (
|
||||||
|
0 => 0x20D0,
|
||||||
|
1 => 0x20FF,
|
||||||
|
2 => 'Combining Diacritical Marks for Symbols',
|
||||||
|
),
|
||||||
|
58 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2100,
|
||||||
|
1 => 0x214F,
|
||||||
|
2 => 'Letterlike Symbols',
|
||||||
|
),
|
||||||
|
59 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2150,
|
||||||
|
1 => 0x218F,
|
||||||
|
2 => 'Number Forms',
|
||||||
|
),
|
||||||
|
60 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2190,
|
||||||
|
1 => 0x21FF,
|
||||||
|
2 => 'Arrows',
|
||||||
|
),
|
||||||
|
61 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2200,
|
||||||
|
1 => 0x22FF,
|
||||||
|
2 => 'Mathematical Operators',
|
||||||
|
),
|
||||||
|
62 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2300,
|
||||||
|
1 => 0x23FF,
|
||||||
|
2 => 'Miscellaneous Technical',
|
||||||
|
),
|
||||||
|
63 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2400,
|
||||||
|
1 => 0x243F,
|
||||||
|
2 => 'Control Pictures',
|
||||||
|
),
|
||||||
|
64 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2440,
|
||||||
|
1 => 0x245F,
|
||||||
|
2 => 'Optical Character Recognition',
|
||||||
|
),
|
||||||
|
65 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2460,
|
||||||
|
1 => 0x24FF,
|
||||||
|
2 => 'Enclosed Alphanumerics',
|
||||||
|
),
|
||||||
|
66 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2500,
|
||||||
|
1 => 0x257F,
|
||||||
|
2 => 'Box Drawing',
|
||||||
|
),
|
||||||
|
67 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2580,
|
||||||
|
1 => 0x259F,
|
||||||
|
2 => 'Block Elements',
|
||||||
|
),
|
||||||
|
68 =>
|
||||||
|
array (
|
||||||
|
0 => 0x25A0,
|
||||||
|
1 => 0x25FF,
|
||||||
|
2 => 'Geometric Shapes',
|
||||||
|
),
|
||||||
|
69 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2600,
|
||||||
|
1 => 0x26FF,
|
||||||
|
2 => 'Miscellaneous Symbols',
|
||||||
|
),
|
||||||
|
70 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2700,
|
||||||
|
1 => 0x27BF,
|
||||||
|
2 => 'Dingbats',
|
||||||
|
),
|
||||||
|
71 =>
|
||||||
|
array (
|
||||||
|
0 => 0x27C0,
|
||||||
|
1 => 0x27EF,
|
||||||
|
2 => 'Miscellaneous Mathematical Symbols-A',
|
||||||
|
),
|
||||||
|
72 =>
|
||||||
|
array (
|
||||||
|
0 => 0x27F0,
|
||||||
|
1 => 0x27FF,
|
||||||
|
2 => 'Supplemental Arrows-A',
|
||||||
|
),
|
||||||
|
73 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2800,
|
||||||
|
1 => 0x28FF,
|
||||||
|
2 => 'Braille Patterns',
|
||||||
|
),
|
||||||
|
74 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2900,
|
||||||
|
1 => 0x297F,
|
||||||
|
2 => 'Supplemental Arrows-B',
|
||||||
|
),
|
||||||
|
75 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2980,
|
||||||
|
1 => 0x29FF,
|
||||||
|
2 => 'Miscellaneous Mathematical Symbols-B',
|
||||||
|
),
|
||||||
|
76 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2A00,
|
||||||
|
1 => 0x2AFF,
|
||||||
|
2 => 'Supplemental Mathematical Operators',
|
||||||
|
),
|
||||||
|
77 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2B00,
|
||||||
|
1 => 0x2BFF,
|
||||||
|
2 => 'Miscellaneous Symbols and Arrows',
|
||||||
|
),
|
||||||
|
78 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2C00,
|
||||||
|
1 => 0x2C5F,
|
||||||
|
2 => 'Glagolitic',
|
||||||
|
),
|
||||||
|
79 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2C80,
|
||||||
|
1 => 0x2CFF,
|
||||||
|
2 => 'Coptic',
|
||||||
|
),
|
||||||
|
80 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2D00,
|
||||||
|
1 => 0x2D2F,
|
||||||
|
2 => 'Georgian Supplement',
|
||||||
|
),
|
||||||
|
81 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2D30,
|
||||||
|
1 => 0x2D7F,
|
||||||
|
2 => 'Tifinagh',
|
||||||
|
),
|
||||||
|
82 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2D80,
|
||||||
|
1 => 0x2DDF,
|
||||||
|
2 => 'Ethiopic Extended',
|
||||||
|
),
|
||||||
|
83 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2E00,
|
||||||
|
1 => 0x2E7F,
|
||||||
|
2 => 'Supplemental Punctuation',
|
||||||
|
),
|
||||||
|
84 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2E80,
|
||||||
|
1 => 0x2EFF,
|
||||||
|
2 => 'CJK Radicals Supplement',
|
||||||
|
),
|
||||||
|
85 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2F00,
|
||||||
|
1 => 0x2FDF,
|
||||||
|
2 => 'Kangxi Radicals',
|
||||||
|
),
|
||||||
|
86 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2FF0,
|
||||||
|
1 => 0x2FFF,
|
||||||
|
2 => 'Ideographic Description Characters',
|
||||||
|
),
|
||||||
|
87 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3000,
|
||||||
|
1 => 0x303F,
|
||||||
|
2 => 'CJK Symbols and Punctuation',
|
||||||
|
),
|
||||||
|
88 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3040,
|
||||||
|
1 => 0x309F,
|
||||||
|
2 => 'Hiragana',
|
||||||
|
),
|
||||||
|
89 =>
|
||||||
|
array (
|
||||||
|
0 => 0x30A0,
|
||||||
|
1 => 0x30FF,
|
||||||
|
2 => 'Katakana',
|
||||||
|
),
|
||||||
|
90 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3100,
|
||||||
|
1 => 0x312F,
|
||||||
|
2 => 'Bopomofo',
|
||||||
|
),
|
||||||
|
91 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3130,
|
||||||
|
1 => 0x318F,
|
||||||
|
2 => 'Hangul Compatibility Jamo',
|
||||||
|
),
|
||||||
|
92 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3190,
|
||||||
|
1 => 0x319F,
|
||||||
|
2 => 'Kanbun',
|
||||||
|
),
|
||||||
|
93 =>
|
||||||
|
array (
|
||||||
|
0 => 0x31A0,
|
||||||
|
1 => 0x31BF,
|
||||||
|
2 => 'Bopomofo Extended',
|
||||||
|
),
|
||||||
|
94 =>
|
||||||
|
array (
|
||||||
|
0 => 0x31C0,
|
||||||
|
1 => 0x31EF,
|
||||||
|
2 => 'CJK Strokes',
|
||||||
|
),
|
||||||
|
95 =>
|
||||||
|
array (
|
||||||
|
0 => 0x31F0,
|
||||||
|
1 => 0x31FF,
|
||||||
|
2 => 'Katakana Phonetic Extensions',
|
||||||
|
),
|
||||||
|
96 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3200,
|
||||||
|
1 => 0x32FF,
|
||||||
|
2 => 'Enclosed CJK Letters and Months',
|
||||||
|
),
|
||||||
|
97 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3300,
|
||||||
|
1 => 0x33FF,
|
||||||
|
2 => 'CJK Compatibility',
|
||||||
|
),
|
||||||
|
98 =>
|
||||||
|
array (
|
||||||
|
0 => 0x3400,
|
||||||
|
1 => 0x4DBF,
|
||||||
|
2 => 'CJK Unified Ideographs Extension A',
|
||||||
|
),
|
||||||
|
99 =>
|
||||||
|
array (
|
||||||
|
0 => 0x4DC0,
|
||||||
|
1 => 0x4DFF,
|
||||||
|
2 => 'Yijing Hexagram Symbols',
|
||||||
|
),
|
||||||
|
100 =>
|
||||||
|
array (
|
||||||
|
0 => 0x4E00,
|
||||||
|
1 => 0x9FFF,
|
||||||
|
2 => 'CJK Unified Ideographs',
|
||||||
|
),
|
||||||
|
101 =>
|
||||||
|
array (
|
||||||
|
0 => 0xA000,
|
||||||
|
1 => 0xA48F,
|
||||||
|
2 => 'Yi Syllables',
|
||||||
|
),
|
||||||
|
102 =>
|
||||||
|
array (
|
||||||
|
0 => 0xA490,
|
||||||
|
1 => 0xA4CF,
|
||||||
|
2 => 'Yi Radicals',
|
||||||
|
),
|
||||||
|
103 =>
|
||||||
|
array (
|
||||||
|
0 => 0xA700,
|
||||||
|
1 => 0xA71F,
|
||||||
|
2 => 'Modifier Tone Letters',
|
||||||
|
),
|
||||||
|
104 =>
|
||||||
|
array (
|
||||||
|
0 => 0xA800,
|
||||||
|
1 => 0xA82F,
|
||||||
|
2 => 'Syloti Nagri',
|
||||||
|
),
|
||||||
|
105 =>
|
||||||
|
array (
|
||||||
|
0 => 0xAC00,
|
||||||
|
1 => 0xD7AF,
|
||||||
|
2 => 'Hangul Syllables',
|
||||||
|
),
|
||||||
|
106 =>
|
||||||
|
array (
|
||||||
|
0 => 0xD800,
|
||||||
|
1 => 0xDB7F,
|
||||||
|
2 => 'High Surrogates',
|
||||||
|
),
|
||||||
|
107 =>
|
||||||
|
array (
|
||||||
|
0 => 0xDB80,
|
||||||
|
1 => 0xDBFF,
|
||||||
|
2 => 'High Private Use Surrogates',
|
||||||
|
),
|
||||||
|
108 =>
|
||||||
|
array (
|
||||||
|
0 => 0xDC00,
|
||||||
|
1 => 0xDFFF,
|
||||||
|
2 => 'Low Surrogates',
|
||||||
|
),
|
||||||
|
109 =>
|
||||||
|
array (
|
||||||
|
0 => 0xE000,
|
||||||
|
1 => 0xF8FF,
|
||||||
|
2 => 'Private Use Area',
|
||||||
|
),
|
||||||
|
110 =>
|
||||||
|
array (
|
||||||
|
0 => 0xF900,
|
||||||
|
1 => 0xFAFF,
|
||||||
|
2 => 'CJK Compatibility Ideographs',
|
||||||
|
),
|
||||||
|
111 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFB00,
|
||||||
|
1 => 0xFB4F,
|
||||||
|
2 => 'Alphabetic Presentation Forms',
|
||||||
|
),
|
||||||
|
112 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFB50,
|
||||||
|
1 => 0xFDFF,
|
||||||
|
2 => 'Arabic Presentation Forms-A',
|
||||||
|
),
|
||||||
|
113 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE00,
|
||||||
|
1 => 0xFE0F,
|
||||||
|
2 => 'Variation Selectors',
|
||||||
|
),
|
||||||
|
114 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE10,
|
||||||
|
1 => 0xFE1F,
|
||||||
|
2 => 'Vertical Forms',
|
||||||
|
),
|
||||||
|
115 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE20,
|
||||||
|
1 => 0xFE2F,
|
||||||
|
2 => 'Combining Half Marks',
|
||||||
|
),
|
||||||
|
116 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE30,
|
||||||
|
1 => 0xFE4F,
|
||||||
|
2 => 'CJK Compatibility Forms',
|
||||||
|
),
|
||||||
|
117 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE50,
|
||||||
|
1 => 0xFE6F,
|
||||||
|
2 => 'Small Form Variants',
|
||||||
|
),
|
||||||
|
118 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFE70,
|
||||||
|
1 => 0xFEFF,
|
||||||
|
2 => 'Arabic Presentation Forms-B',
|
||||||
|
),
|
||||||
|
119 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFF00,
|
||||||
|
1 => 0xFFEF,
|
||||||
|
2 => 'Halfwidth and Fullwidth Forms',
|
||||||
|
),
|
||||||
|
120 =>
|
||||||
|
array (
|
||||||
|
0 => 0xFFF0,
|
||||||
|
1 => 0xFFFF,
|
||||||
|
2 => 'Specials',
|
||||||
|
),
|
||||||
|
121 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10000,
|
||||||
|
1 => 0x1007F,
|
||||||
|
2 => 'Linear B Syllabary',
|
||||||
|
),
|
||||||
|
122 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10080,
|
||||||
|
1 => 0x100FF,
|
||||||
|
2 => 'Linear B Ideograms',
|
||||||
|
),
|
||||||
|
123 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10100,
|
||||||
|
1 => 0x1013F,
|
||||||
|
2 => 'Aegean Numbers',
|
||||||
|
),
|
||||||
|
124 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10140,
|
||||||
|
1 => 0x1018F,
|
||||||
|
2 => 'Ancient Greek Numbers',
|
||||||
|
),
|
||||||
|
125 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10300,
|
||||||
|
1 => 0x1032F,
|
||||||
|
2 => 'Old Italic',
|
||||||
|
),
|
||||||
|
126 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10330,
|
||||||
|
1 => 0x1034F,
|
||||||
|
2 => 'Gothic',
|
||||||
|
),
|
||||||
|
127 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10380,
|
||||||
|
1 => 0x1039F,
|
||||||
|
2 => 'Ugaritic',
|
||||||
|
),
|
||||||
|
128 =>
|
||||||
|
array (
|
||||||
|
0 => 0x103A0,
|
||||||
|
1 => 0x103DF,
|
||||||
|
2 => 'Old Persian',
|
||||||
|
),
|
||||||
|
129 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10400,
|
||||||
|
1 => 0x1044F,
|
||||||
|
2 => 'Deseret',
|
||||||
|
),
|
||||||
|
130 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10450,
|
||||||
|
1 => 0x1047F,
|
||||||
|
2 => 'Shavian',
|
||||||
|
),
|
||||||
|
131 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10480,
|
||||||
|
1 => 0x104AF,
|
||||||
|
2 => 'Osmanya',
|
||||||
|
),
|
||||||
|
132 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10800,
|
||||||
|
1 => 0x1083F,
|
||||||
|
2 => 'Cypriot Syllabary',
|
||||||
|
),
|
||||||
|
133 =>
|
||||||
|
array (
|
||||||
|
0 => 0x10A00,
|
||||||
|
1 => 0x10A5F,
|
||||||
|
2 => 'Kharoshthi',
|
||||||
|
),
|
||||||
|
134 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D000,
|
||||||
|
1 => 0x1D0FF,
|
||||||
|
2 => 'Byzantine Musical Symbols',
|
||||||
|
),
|
||||||
|
135 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D100,
|
||||||
|
1 => 0x1D1FF,
|
||||||
|
2 => 'Musical Symbols',
|
||||||
|
),
|
||||||
|
136 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D200,
|
||||||
|
1 => 0x1D24F,
|
||||||
|
2 => 'Ancient Greek Musical Notation',
|
||||||
|
),
|
||||||
|
137 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D300,
|
||||||
|
1 => 0x1D35F,
|
||||||
|
2 => 'Tai Xuan Jing Symbols',
|
||||||
|
),
|
||||||
|
138 =>
|
||||||
|
array (
|
||||||
|
0 => 0x1D400,
|
||||||
|
1 => 0x1D7FF,
|
||||||
|
2 => 'Mathematical Alphanumeric Symbols',
|
||||||
|
),
|
||||||
|
139 =>
|
||||||
|
array (
|
||||||
|
0 => 0x20000,
|
||||||
|
1 => 0x2A6DF,
|
||||||
|
2 => 'CJK Unified Ideographs Extension B',
|
||||||
|
),
|
||||||
|
140 =>
|
||||||
|
array (
|
||||||
|
0 => 0x2F800,
|
||||||
|
1 => 0x2FA1F,
|
||||||
|
2 => 'CJK Compatibility Ideographs Supplement',
|
||||||
|
),
|
||||||
|
141 =>
|
||||||
|
array (
|
||||||
|
0 => 0xE0000,
|
||||||
|
1 => 0xE007F,
|
||||||
|
2 => 'Tags',
|
||||||
|
),
|
||||||
|
142 =>
|
||||||
|
array (
|
||||||
|
0 => 0xE0100,
|
||||||
|
1 => 0xE01EF,
|
||||||
|
2 => 'Variation Selectors Supplement',
|
||||||
|
),
|
||||||
|
143 =>
|
||||||
|
array (
|
||||||
|
0 => 0xF0000,
|
||||||
|
1 => 0xFFFFF,
|
||||||
|
2 => 'Supplementary Private Use Area-A',
|
||||||
|
),
|
||||||
|
144 =>
|
||||||
|
array (
|
||||||
|
0 => 0x100000,
|
||||||
|
1 => 0x10FFFF,
|
||||||
|
2 => 'Supplementary Private Use Area-B',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
?>
|
246
vendor/pear/text_languagedetect/package.xml
vendored
Normal file
246
vendor/pear/text_languagedetect/package.xml
vendored
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<package packagerversion="1.7.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
|
||||||
|
http://pear.php.net/dtd/tasks-1.0.xsd
|
||||||
|
http://pear.php.net/dtd/package-2.0
|
||||||
|
http://pear.php.net/dtd/package-2.0.xsd">
|
||||||
|
<name>Text_LanguageDetect</name>
|
||||||
|
<channel>pear.php.net</channel>
|
||||||
|
<summary>Language detection class</summary>
|
||||||
|
<description>Text_LanguageDetect can identify 52 human languages from text samples and return confidence scores for each.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<lead>
|
||||||
|
<name>Nicholas Pisarro</name>
|
||||||
|
<user>taak</user>
|
||||||
|
<email>taak@php.net</email>
|
||||||
|
<active>no</active>
|
||||||
|
</lead>
|
||||||
|
|
||||||
|
<date>2017-03-02</date>
|
||||||
|
<time>18:00:42</time>
|
||||||
|
<version>
|
||||||
|
<release>1.0.0</release>
|
||||||
|
<api>1.0.0</api>
|
||||||
|
</version>
|
||||||
|
|
||||||
|
<stability>
|
||||||
|
<release>stable</release>
|
||||||
|
<api>stable</api>
|
||||||
|
</stability>
|
||||||
|
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
|
||||||
|
<notes>
|
||||||
|
- Add PHP5 constructors
|
||||||
|
- Fix bug #21189: Language detection on PHP7 broken
|
||||||
|
- Fix coding style problems
|
||||||
|
- BC break: Add real visibility to properties and methods
|
||||||
|
</notes>
|
||||||
|
|
||||||
|
<contents>
|
||||||
|
<dir name="/">
|
||||||
|
<file name="README.rst" role="doc" />
|
||||||
|
<dir name="data">
|
||||||
|
<file name="lang.dat" role="data" />
|
||||||
|
<file name="unicode_blocks.dat" role="data" />
|
||||||
|
</dir> <!-- /data -->
|
||||||
|
<dir name="docs">
|
||||||
|
<file name="confidence.php" role="doc" />
|
||||||
|
<file name="example_clui.php" role="doc" />
|
||||||
|
<file name="example_web.php" role="doc" />
|
||||||
|
<file name="iso.php" role="doc" />
|
||||||
|
<file name="languages.php" role="doc" />
|
||||||
|
<file name="simple.php" role="doc" />
|
||||||
|
</dir> <!-- /docs -->
|
||||||
|
<dir name="tests">
|
||||||
|
<file name="PrivProxy.php" role="test" />
|
||||||
|
<file name="Text_LanguageDetectTest.php" role="test" />
|
||||||
|
<file name="Text_LanguageDetect_ISO639Test.php" role="test" />
|
||||||
|
</dir> <!-- /tests -->
|
||||||
|
<dir name="Text">
|
||||||
|
<dir name="LanguageDetect">
|
||||||
|
<file name="Exception.php" role="php">
|
||||||
|
<tasks:replace from="@package_version@" to="version" type="package-info" />
|
||||||
|
</file>
|
||||||
|
<file name="ISO639.php" role="php">
|
||||||
|
<tasks:replace from="@package_version@" to="version" type="package-info" />
|
||||||
|
</file>
|
||||||
|
<file name="Parser.php" role="php">
|
||||||
|
<tasks:replace from="@package_version@" to="version" type="package-info" />
|
||||||
|
</file>
|
||||||
|
</dir> <!-- /Text/LanguageDetect -->
|
||||||
|
<file name="LanguageDetect.php" role="php">
|
||||||
|
<tasks:replace from="@package_version@" to="version" type="package-info" />
|
||||||
|
<tasks:replace from="@data_dir@" to="data_dir" type="pear-config" />
|
||||||
|
</file>
|
||||||
|
</dir> <!-- /Text -->
|
||||||
|
</dir> <!-- / -->
|
||||||
|
</contents>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<required>
|
||||||
|
<php>
|
||||||
|
<min>5.4</min>
|
||||||
|
</php>
|
||||||
|
<pearinstaller>
|
||||||
|
<min>1.9.0</min>
|
||||||
|
</pearinstaller>
|
||||||
|
<extension>
|
||||||
|
<name>pcre</name>
|
||||||
|
</extension>
|
||||||
|
</required>
|
||||||
|
<optional>
|
||||||
|
<extension>
|
||||||
|
<name>mbstring</name>
|
||||||
|
</extension>
|
||||||
|
</optional>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<phprelease>
|
||||||
|
<filelist>
|
||||||
|
<install as="lang.dat" name="data/lang.dat" />
|
||||||
|
<install as="unicode_blocks.dat" name="data/unicode_blocks.dat" />
|
||||||
|
</filelist>
|
||||||
|
</phprelease>
|
||||||
|
|
||||||
|
<changelog>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>1.0.0</release>
|
||||||
|
<api>1.0.0</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>stable</release>
|
||||||
|
<api>stable</api>
|
||||||
|
</stability>
|
||||||
|
<date>2017-03-02</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>
|
||||||
|
- Add PHP5 constructors
|
||||||
|
- Fix bug #21189: Language detection on PHP7 broken
|
||||||
|
- Fix coding style problems
|
||||||
|
- BC break: Add real visibility to properties and methods
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.3.0</release>
|
||||||
|
<api>0.3.0</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2012-01-16</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>
|
||||||
|
- BC break: Return lowercase language names
|
||||||
|
- BC break: Use exceptions instead of PEAR_Error
|
||||||
|
- Implement request #19221: Return ISO 639-1 or ISO 639-2 language codes
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.2.3</release>
|
||||||
|
<api>0.2.3</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2008-07-30</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>updated package requirements
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.2.2</release>
|
||||||
|
<api>0.2.2</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2008-07-30</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>* Fixed Bug #13385
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.2.1</release>
|
||||||
|
<api>0.2.1</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2006-12-03</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>* Fix: Now uses conventionalized include path
|
||||||
|
* Fix: Won't cause error if input is purely symbol-range characters
|
||||||
|
* Better error reporting if error in unicode db loading
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.2.0</release>
|
||||||
|
<api>0.2.0</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2006-01-18</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>* Added unicode block range identification
|
||||||
|
* unicode block ranges used to optimize language detection by pre-selecting which known language trigram profiles in the database to attempt comparison with
|
||||||
|
* Added several utf8/unicode utility functions
|
||||||
|
* new Parser class for building data profiles from text samples
|
||||||
|
* Fix: mb_convert_encoding() now used correctly
|
||||||
|
* Fix: basic case-folding for Cyrillic alphabet implemented
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.1.1</release>
|
||||||
|
<api>0.1.1</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2006-01-06</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>* Output of clustering now cached
|
||||||
|
* Fix: better error checking in clustering functions
|
||||||
|
* Fix: clusteredSearch() now handles null strings gracefully
|
||||||
|
* Compare order is preserved in clusteredSearch() results
|
||||||
|
* Slight speed improvement to utf8 iterator
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
|
||||||
|
<release>
|
||||||
|
<version>
|
||||||
|
<release>0.1.0</release>
|
||||||
|
<api>0.1.0</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>alpha</release>
|
||||||
|
<api>alpha</api>
|
||||||
|
</stability>
|
||||||
|
<date>2006-01-04</date>
|
||||||
|
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
|
||||||
|
<notes>Initial PEAR release
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
|
</changelog>
|
||||||
|
</package>
|
Reference in New Issue
Block a user