namespace NT;
class Tags {
public function makeTags($string) {
$remove = array("a", "an", "the", "is", "are", "i", "we", "you", "he", "she", "it",
"they", "has", "had", "have", "be", "been", "do", "does", "done", "did", "in",
"was", "were", "here", "there", "where", "when", "how", "why", "to",
"and", "or", "this", "that", "there", "those", "them", "their", "me",
"my", "am", "on", "so", "at", "as", "of", "with", "will", "shall", "event");
$symbols = array(".", ",", "!", "\"", "'", "?", "/", "[", "]", "{", "}", "!",
"@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "_", "+", "=", "\\", "`", "~");
$string = explode(" ", str_replace($symbols, " ", $string));
$tags = array();
foreach ($string as $word) {
$word = strtolower(trim($word));
if (!in_array($word, $remove) && $word != "" && !is_numeric($word)) {
$word = stem($word);
if (!in_array($word, $tags))
$tags[] = $word;
}
}
return $tags;
}
}