From 74a752879bcad54daa62994f9eae42fe4afdd299 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 25 Nov 2015 21:07:24 +0300 Subject: af_sort_bayes: move to -attic repo, not really suitable for production use of any kind --- .../lib/class.naivebayesian_ngram.php | 52 ---------------------- 1 file changed, 52 deletions(-) delete mode 100644 plugins/af_sort_bayes/lib/class.naivebayesian_ngram.php (limited to 'plugins/af_sort_bayes/lib/class.naivebayesian_ngram.php') diff --git a/plugins/af_sort_bayes/lib/class.naivebayesian_ngram.php b/plugins/af_sort_bayes/lib/class.naivebayesian_ngram.php deleted file mode 100644 index cee2bb1d7..000000000 --- a/plugins/af_sort_bayes/lib/class.naivebayesian_ngram.php +++ /dev/null @@ -1,52 +0,0 @@ -N = $n; - - return true; - } - - /** - * override method for ngram - * - * @param string $string - * @return multiple - */ - function _getTokens($string) { - $tokens = array(); - - if (mb_strlen($string)) { - for ($i = 0; $i < mb_strlen($string) - $this->N; $i++) { - $wd = mb_substr($string, $i, $this->N); - - if (mb_strlen($wd) == $this->N) { - if (!array_key_exists($wd, $tokens)) { - $tokens[$wd] = 0; - } - - $tokens[$wd]++; - } - } - } - - if (count($tokens)) { - // remove empty value - $tokens = array_filter($tokens); - } - - return $tokens; - } - - } -- cgit v1.2.3