protected function splitText($text)
    {
        $punctuations = preg_quote(implode('', $this->punctuations), '/');

        $text = preg_replace('/([^\p{Han}\s'.$punctuations.']+)/u', "\t\t\t$1\t\t", $text);

        $array = [];

        foreach (preg_split('/\t\t/u', $text, -1, PREG_SPLIT_NO_EMPTY) as $item) {
            $array[] = ("\t" === $item[0])
                ? substr($item, 1)
                : preg_split('//u', $item, -1, PREG_SPLIT_NO_EMPTY);
        }

        return $this->flatten($array);
    }
protected function splitText($text)
    {
        $punctuations = preg_quote(implode('', $this->punctuations), '/');

        $text = preg_replace('/([^\p{Han}\s'.$punctuations.']+)/u', "\t\t\t$1\t\t", $text);

        $array = [];

        foreach (preg_split('/\t\t/u', $text, -1, PREG_SPLIT_NO_EMPTY) as $item) {
            $array[] = ("\t" === $item[0])
                ? substr($item, 1)
                : preg_split('//u', $item, -1, PREG_SPLIT_NO_EMPTY);
        }

        return $this->flatten($array);
    }
protected function splitText ( $ text ) { $ punctuations = preg_quote ( implode ( '' , $ this -> punctuations ) , '/' ) ; $ text = preg_replace ( '/([^\p{Han}\s' . $ punctuations . ']+)/u' , "\t\t\t$1\t\t" , $ text ) ; $ array = [ ] ; foreach ( preg_split ( '/\t\t/u' , $ text , - 1 , PREG_SPLIT_NO_EMPTY ) as $ item ) { $ array [ ] = ( "\t" === $ item [ 0 ] ) ? substr ( $ item , 1 ) : preg_split ( '//u' , $ item , - 1 , PREG_SPLIT_NO_EMPTY ) ; } return $ this -> flatten ( $ array ) ; }
Spilt text to array.

@param string $text

@return array
Spilt text to array .