public static function __cutAll($sentence, $options = array())
{
$defaults = array('mode' => 'default');
$options = array_merge($defaults, $options);
$words = array();
$DAG = self::getDAG($sentence);
$old_j = -1;
foreach ($DAG as $k => $L) {
if (count($L) == 1 && $k > $old_j) {
$word = mb_substr($sentence, $k, $L[0] - $k + 1, 'UTF-8');
array_push($words, $word);
$old_j = $L[0];
} else {
foreach ($L as $j) {
if ($j > $k) {
$word = mb_substr($sentence, $k, $j - $k + 1, 'UTF-8');
array_push($words, $word);
$old_j = $j;
}
}
}
}
return $words;
}