Revert "Update languagedetect library"

This commit is contained in:
Tobias Diekershoff 2017-10-05 11:58:18 +02:00 committed by GitHub
parent c22920edba
commit 071946fa78
101 changed files with 3632 additions and 311 deletions

View file

@ -364,9 +364,13 @@ function item_add_language_opt(&$arr) {
$postopts = "";
}
require_once('library/langdet/Text/LanguageDetect.php');
$naked_body = preg_replace('/\[(.+?)\]/','', $arr['body']);
$LanguageDetect = new Text_LanguageDetect();
$lng = $LanguageDetect->detect($naked_body, 3);
$l = new Text_LanguageDetect();
//$lng = $l->detectConfidence($naked_body);
//$arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : '');
$lng = $l->detect($naked_body, 3);
if (sizeof($lng) > 0) {
if ($postopts != "") $postopts .= '&'; // arbitrary separator, to be reviewed