summaryrefslogtreecommitdiff
path: root/plugins/af_lang_detect/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-08-12 18:15:04 +0300
committerAndrew Dolgov <[email protected]>2018-08-12 18:15:04 +0300
commit83da40251fbf3409a3b89a107fdf63eed805c28b (patch)
treeac745d68c247cbc77f248a13faed3086e64febde /plugins/af_lang_detect/init.php
parentf12907466639ecdc2e14b3b98a75a09a7b1332a7 (diff)
plugins: move af_lang_detect to tt-rss-attic repository
Diffstat (limited to 'plugins/af_lang_detect/init.php')
-rw-r--r--plugins/af_lang_detect/init.php45
1 files changed, 0 insertions, 45 deletions
diff --git a/plugins/af_lang_detect/init.php b/plugins/af_lang_detect/init.php
deleted file mode 100644
index 3ec0023b6..000000000
--- a/plugins/af_lang_detect/init.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-class Af_Lang_Detect extends Plugin {
- private $host;
- private $lang;
-
- function about() {
- return array(1.1,
- "Detect article language",
- "fox");
- }
-
- function init($host) {
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
-
- require_once __DIR__ . "/languagedetect/Text/LanguageDetect.php";
-
- $this->lang = new Text_LanguageDetect();
- $this->lang->setNameMode(2);
- }
-
- function hook_article_filter($article) {
-
- if ($this->lang) {
- $entry_language = $this->lang->detect($article['title'] . " " . $article['content'], 1);
-
- if (count($entry_language) > 0) {
- $possible = array_keys($entry_language);
- $entry_language = $possible[0];
-
- _debug("detected language: $entry_language");
-
- $article["language"] = $entry_language;
- }
- }
-
- return $article;
- }
-
- function api_version() {
- return 2;
- }
-
-}