7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Search_Lucene
17 * @subpackage Analysis
18 * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
23 /** Zend_Search_Lucene_Analysis_TokenFilter */
24 require_once $CFG->dirroot.'/search/Zend/Search/Lucene/Analysis/TokenFilter.php';
28 * Lower case Token filter.
31 * @package Zend_Search_Lucene
32 * @subpackage Analysis
33 * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
34 * @license http://framework.zend.com/license/new-bsd New BSD License
37 class Zend_Search_Lucene_Analysis_TokenFilter_LowerCase extends Zend_Search_Lucene_Analysis_TokenFilter
40 * Normalize Token or remove it (if null is returned)
42 * @param Zend_Search_Lucene_Analysis_Token $srcToken
43 * @return Zend_Search_Lucene_Analysis_Token
45 public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
47 $newToken = new Zend_Search_Lucene_Analysis_Token(
48 strtolower( $srcToken->getTermText() ),
49 $srcToken->getStartOffset(),
50 $srcToken->getEndOffset());
52 $newToken->setPositionIncrement($srcToken->getPositionIncrement());