diff options
author | friendica <info@friendica.com> | 2012-02-01 19:23:05 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-02-01 19:23:05 -0800 |
commit | 64d0616762efcff413a335f2fdde4d8219d44895 (patch) | |
tree | 5a8f944c500ab6e7d5a061e1bca689c9a970041e /library/spam/b8/b8.php | |
parent | c8c062d96024a23e67e73f1ebffcf7009b18eed1 (diff) | |
download | volse-hubzilla-64d0616762efcff413a335f2fdde4d8219d44895.tar.gz volse-hubzilla-64d0616762efcff413a335f2fdde4d8219d44895.tar.bz2 volse-hubzilla-64d0616762efcff413a335f2fdde4d8219d44895.zip |
add uid variable to b8 classes
Diffstat (limited to 'library/spam/b8/b8.php')
-rw-r--r-- | library/spam/b8/b8.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/spam/b8/b8.php b/library/spam/b8/b8.php index ea1e15ffa..28a3dd29f 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); } |