public function simplify($text)
    {
        //UTF-8
        $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
        // Lowercase
        $text = mb_strtolower($text, 'UTF-8');

        // To improve searching for numerical data such as dates, IP addresses
        // or version numbers, we consider a group of numerical characters
        // separated only by punctuation characters to be one piece.
        // This also means that searching for e.g. '20/03/1984' also returns
        // results with '20-03-1984' in them.
        // Readable regexp: ([number]+)[punctuation]+(?=[number])
        $text = preg_replace('/([' . $this->getClassNumbers() . ']+)[' . $this->getClassPunctuation() . ']+(?=[' . $this->getClassNumbers() . '])/u', '\1', $text);

        // Multiple dot and dash groups are word boundaries and replaced with space.
        // No need to use the unicode modifier here because 0-127 ASCII characters
        // can't match higher UTF-8 characters as the leftmost bit of those are 1.
        $text = preg_replace('/[.-]{2,}/', ' ', $text);

        // The dot, underscore and dash are simply removed. This allows meaningful
        // search behavior with acronyms and URLs. See unicode note directly above.
        $text = preg_replace('/[._-]+/', '', $text);

        // With the exception of the rules above, we consider all punctuation,
        // marks, spacers, etc, to be a word boundary.
        $text = preg_replace('/[' . $this->getClassWordBoundary() . ']+/u', ' ', $text);

        return trim($text);
    }
public function simplify($text)
    {
        //UTF-8
        $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
        // Lowercase
        $text = mb_strtolower($text, 'UTF-8');

        // To improve searching for numerical data such as dates, IP addresses
        // or version numbers, we consider a group of numerical characters
        // separated only by punctuation characters to be one piece.
        // This also means that searching for e.g. '20/03/1984' also returns
        // results with '20-03-1984' in them.
        // Readable regexp: ([number]+)[punctuation]+(?=[number])
        $text = preg_replace('/([' . $this->getClassNumbers() . ']+)[' . $this->getClassPunctuation() . ']+(?=[' . $this->getClassNumbers() . '])/u', '\1', $text);

        // Multiple dot and dash groups are word boundaries and replaced with space.
        // No need to use the unicode modifier here because 0-127 ASCII characters
        // can't match higher UTF-8 characters as the leftmost bit of those are 1.
        $text = preg_replace('/[.-]{2,}/', ' ', $text);

        // The dot, underscore and dash are simply removed. This allows meaningful
        // search behavior with acronyms and URLs. See unicode note directly above.
        $text = preg_replace('/[._-]+/', '', $text);

        // With the exception of the rules above, we consider all punctuation,
        // marks, spacers, etc, to be a word boundary.
        $text = preg_replace('/[' . $this->getClassWordBoundary() . ']+/u', ' ', $text);

        return trim($text);
    }
public function simplify ( $ text ) { //UTF-8 $ text = html_entity_decode ( $ text , ENT_QUOTES , 'UTF-8' ) ; // Lowercase $ text = mb_strtolower ( $ text , 'UTF-8' ) ; // To improve searching for numerical data such as dates, IP addresses // or version numbers, we consider a group of numerical characters // separated only by punctuation characters to be one piece. // This also means that searching for e.g. '20/03/1984' also returns // results with '20-03-1984' in them. // Readable regexp: ([number]+)[punctuation]+(?=[number]) $ text = preg_replace ( '/([' . $ this -> getClassNumbers ( ) . ']+)[' . $ this -> getClassPunctuation ( ) . ']+(?=[' . $ this -> getClassNumbers ( ) . '])/u' , '\1' , $ text ) ; // Multiple dot and dash groups are word boundaries and replaced with space. // No need to use the unicode modifier here because 0-127 ASCII characters // can't match higher UTF-8 characters as the leftmost bit of those are 1. $ text = preg_replace ( '/[.-]{2,}/' , ' ' , $ text ) ; // The dot, underscore and dash are simply removed. This allows meaningful // search behavior with acronyms and URLs. See unicode note directly above. $ text = preg_replace ( '/[._-]+/' , '' , $ text ) ; // With the exception of the rules above, we consider all punctuation, // marks, spacers, etc, to be a word boundary. $ text = preg_replace ( '/[' . $ this -> getClassWordBoundary ( ) . ']+/u' , ' ' , $ text ) ; return trim ( $ text ) ; }
Simplifies and preprocesses text for searching.

Processing steps:
- Entities are decoded.
- Text is lower-cased and diacritics (accents) are removed.
- Punctuation is processed (removed or replaced with spaces, depending on
where it is; see code for details).
Simplifies and preprocesses text for searching .