public function hyphenate($string)
    {
        $tokens = $this->tokenizers->tokenize($string);
        $tokens = $this->getHyphenationPattern($tokens);
        $tokens = $this->filter($tokens);
        if (1 === count($tokens) && 1 === $this->getFilters()->count()) {
            $tokens->rewind();
            return $tokens->current()->getHyphenatedContent();
        }

        return $this->getFilters()->concatenate($tokens);
    }
public function hyphenate($string)
    {
        $tokens = $this->tokenizers->tokenize($string);
        $tokens = $this->getHyphenationPattern($tokens);
        $tokens = $this->filter($tokens);
        if (1 === count($tokens) && 1 === $this->getFilters()->count()) {
            $tokens->rewind();
            return $tokens->current()->getHyphenatedContent();
        }

        return $this->getFilters()->concatenate($tokens);
    }
public function hyphenate ( $ string ) { $ tokens = $ this -> tokenizers -> tokenize ( $ string ) ; $ tokens = $ this -> getHyphenationPattern ( $ tokens ) ; $ tokens = $ this -> filter ( $ tokens ) ; if ( 1 === count ( $ tokens ) && 1 === $ this -> getFilters ( ) -> count ( ) ) { $ tokens -> rewind ( ) ; return $ tokens -> current ( ) -> getHyphenatedContent ( ) ; } return $ this -> getFilters ( ) -> concatenate ( $ tokens ) ; }
This method does the actual hyphenation.

The given <var>$string</var> is splitted into chunks (i.e. Words) at
every blank.

After that every chunk is hyphenated and the array of chunks is merged
into a single string using blanks again.

This method does not take into account other word-delimiters than blanks
(eg. returns or tabstops) and it will fail with texts containing markup
in any way.

@param string $string The string to hyphenate

@return string The hyphenated string
This method does the actual hyphenation .