/** * GoCompare! * @since Version 3.10.0 * @return \Railpage\Users\SockpuppetManager */ public function compare() { /** * Load our reference data first */ $ref = array("ips" => json_encode($this->ReferenceUser->getIPs(new DateTime("6 months ago")))); /** * Start our SimHash stuff */ $SimHash = new SimHash(); $Extractor = new SimpleTextExtractor(); $Comparator = new GaussianComparator(3); foreach ($ref as $key => $lookup) { $this->hashes[$key]['reference'] = $SimHash->hash($Extractor->extract($lookup), SimHash::SIMHASH_64); } foreach ($this->suspects as $Suspect) { $suspectData = array("ips" => json_encode($Suspect->getIPs(new DateTime("6 months ago")))); foreach ($suspectData as $key => $lookup) { $this->hashes[$key]['suspect'] = $SimHash->hash($Extractor->extract($lookup), SimHash::SIMHASH_64); } foreach ($this->hashes as $key => $users) { $this->results[$Suspect->id][$key] = $Comparator->compare($users['reference'], $users['suspect']); } } }