src/Tokenizer/WordToken.php
public function getMergedPattern($quality = \Org\Heigl\Hyphenator\Hyphenator::QUALITY_HIGHEST)
    {
        $content = $this->getHyphenateContent();
        $endPattern = str_repeat('0', mb_strlen($content)+1);
        foreach ($this->pattern as $string => $pattern) {
            $strStart = -1;
            while (false !== $strStart = @mb_strpos($content, $string, $strStart + 1)) {
                $strLen   = mb_strlen($string);
                for ($i=0; $i <= $strLen; $i++) {
                    $start = $i+$strStart;
                    $currentQuality = substr($endPattern, $start, 1);
                    $patternQuality = substr($pattern, $i, 1);
                    if ($currentQuality >= $patternQuality) {
                        continue;
                    }
                    if ($quality < $patternQuality) {
                        continue;
                    }
                    $endPattern = substr($endPattern, 0, $start) . $patternQuality . substr($endPattern, $start+1);
                }
            }
        }

        return substr($endPattern, 1, strlen($endPattern)-2);
    }
public function getMergedPattern($quality = \Org\Heigl\Hyphenator\Hyphenator::QUALITY_HIGHEST)
    {
        $content = $this->getHyphenateContent();
        $endPattern = str_repeat('0', mb_strlen($content)+1);
        foreach ($this->pattern as $string => $pattern) {
            $strStart = -1;
            while (false !== $strStart = @mb_strpos($content, $string, $strStart + 1)) {
                $strLen   = mb_strlen($string);
                for ($i=0; $i <= $strLen; $i++) {
                    $start = $i+$strStart;
                    $currentQuality = substr($endPattern, $start, 1);
                    $patternQuality = substr($pattern, $i, 1);
                    if ($currentQuality >= $patternQuality) {
                        continue;
                    }
                    if ($quality < $patternQuality) {
                        continue;
                    }
                    $endPattern = substr($endPattern, 0, $start) . $patternQuality . substr($endPattern, $start+1);
                }
            }
        }

        return substr($endPattern, 1, strlen($endPattern)-2);
    }
Merge the given Hyphenation patterns to one pattern for the given token

This is done using the given quality value.

@param \int $quality The hyphenation quality to use

@return Token