Esempio n. 1
0
    /**
     * Normalize Token or remove it (if null is returned)
     *
     * @param \Zend\Search\Lucene\Analysis\Token $srcToken
     * @return \Zend\Search\Lucene\Analysis\Token
     */
    public function normalize(Token $srcToken)
    {
        $newToken = new Token(mb_strtolower($srcToken->getTermText(), 'UTF-8'),
                                       $srcToken->getStartOffset(),
                                       $srcToken->getEndOffset());

        $newToken->setPositionIncrement($srcToken->getPositionIncrement());

        return $newToken;
    }
Esempio n. 2
0
 /**
  * Normalize Token or remove it (if null is returned)
  *
  * @param \Zend\Search\Lucene\Analysis\Token $srcToken
  * @return \Zend\Search\Lucene\Analysis\Token
  */
 public function normalize(Analysis\Token $srcToken)
 {
     $newToken = new Analysis\Token(strtolower($srcToken->getTermText()), $srcToken->getStartOffset(), $srcToken->getEndOffset());
     $newToken->setPositionIncrement($srcToken->getPositionIncrement());
     return $newToken;
 }