$gDescription = strtolower(strip_tags($group['description'])); //remove links $gDescription = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', ' ', $gDescription); /* * Parse words from group name */ $words_tmp = preg_split('/([\s\-_,:;?!\'=\/\(\)\[\]@{}<>\r\n"]|(?<!\d)\.(?!\d))/', $group['name'], null, PREG_SPLIT_NO_EMPTY); foreach ($words_tmp as $word){ $word = $text->prepareWord($word); if (is_numeric($word)) continue; if (strlen($word)<=2) continue; if ($sWords->isStopWord($word)) continue; $words[] = $word; //if the word is in name and description if (strpos($gDescription, $word)!=false){ $dictionary->add($word."##2"); } else { $dictionary->add($word."##1"); } } /* * Parse words from group description */ $words_tmp = preg_split('/([\s\-_,:;?!\'=\/\(\)\[\]@{}<>\r\n"]|(?<!\d)\.(?!\d))/', $gDescription, null, PREG_SPLIT_NO_EMPTY); foreach ($words_tmp as $word){ $word = $text->prepareWord($word);