public function split_message($text)
{
// Split words
$text = preg_replace('#([^\\p{L}\\p{N}\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text)));
$matches = array();
preg_match_all('#(?:[^\\p{L}\\p{N}*]|^)([+\\-|]?(?:[\\p{L}\\p{N}*]+\'?)*[\\p{L}\\p{N}*])(?:[^\\p{L}\\p{N}*]|$)#u', $text, $matches);
$text = $matches[1];
// remove too short or too long words
$text = array_values($text);
for ($i = 0, $n = sizeof($text); $i < $n; $i++) {
$text[$i] = trim($text[$i]);
if (utf8_strlen($text[$i]) < $this->config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $this->config['fulltext_mysql_max_word_len']) {
unset($text[$i]);
}
}
return array_values($text);
}