static function parseQuery($str) { static $cache = array(); $str = hq::toLower($str); $str = hq::dropSyntax($str); if (isset($cache[$str])) { return $cache[$str]; } $index = array(); $arr = explode(' ', $str); foreach ($arr as $cur) { if ($cur !== '') { $index[hq::morf($cur)] = 1; $index['!' . $cur] = 1; } } $cache[$str] = $index; return $index; }