X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=library%2Fspam%2Fb8%2Fb8.php;h=28a3dd29f9baad93f408ee38a073992c74bfbc40;hb=4530f4ac9db4a3f9d53ef34ee7a185e2b31cc9be;hp=ea1e15ffadc13cee928835b2a16cbd3921213a69;hpb=c8c062d96024a23e67e73f1ebffcf7009b18eed1;p=friendica.git diff --git a/library/spam/b8/b8.php b/library/spam/b8/b8.php index ea1e15ffad..28a3dd29f9 100644 --- a/library/spam/b8/b8.php +++ b/library/spam/b8/b8.php @@ -205,7 +205,7 @@ class b8 * @return float The rating between 0 (ham) and 1 (spam) */ - public function classify($text) + public function classify($uid,$text) { # Validate the startup @@ -217,7 +217,7 @@ class b8 # Get the internal database variables, containing the number of ham and # spam texts so the spam probability can be calculated in relation to them - $internals = $this->_database->get_internals(); + $internals = $this->_database->get_internals($uid); # Calculate the spamminess of all tokens @@ -231,7 +231,7 @@ class b8 return $tokens; # Fetch all availible data for the token set from the database - $this->_token_data = $this->_database->get(array_keys($tokens)); + $this->_token_data = $this->_database->get(array_keys($tokens),$uid); # Calculate the spamminess and importance for each token (or a degenerated form of it) @@ -441,9 +441,9 @@ class b8 * @return void */ - public function learn($text, $category) + public function learn($text, $category, $uid) { - return $this->_process_text($text, $category, self::LEARN); + return $this->_process_text($text, $category, self::LEARN, $uid); } /** @@ -455,9 +455,9 @@ class b8 * @return void */ - public function unlearn($text, $category) + public function unlearn($text, $category, $uid) { - return $this->_process_text($text, $category, self::UNLEARN); + return $this->_process_text($text, $category, self::UNLEARN, $uid); } /** @@ -470,7 +470,7 @@ class b8 * @return void */ - private function _process_text($text, $category, $action) + private function _process_text($text, $category, $action, $uid = 0) { # Validate the startup @@ -494,7 +494,7 @@ class b8 return $tokens; # Pass the tokens and what to do with it to the storage backend - return $this->_database->process_text($tokens, $category, $action); + return $this->_database->process_text($tokens, $category, $action, $uid); }