Token filter that removes stop words. These words must be provided as array (set), example: $stopwords = array('the' => 1, 'an' => '1');

We do recommend to provide all words in lowercase and concatenate this class after the lowercase filter.

category Zend
package Zend_Search_Lucene
subpackage Analysis
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Search_Lucene_Analysis_TokenFilter

 Methods

Constructs new instance of this filter.

__construct(array $stopwords = array()

Parameters

$stopwords

array

array (set) of words that will be filtered out

Fills stopwords set from a text file. Each line contains one stopword, lines with '#' in the first column are ignored (as comments).

loadFromFile(string $filepath = null

You can call this method one or more times. New stopwords are always added to current set.

Parameters

$filepath

string

full path for text file with stopwords

Exceptions

\Zend_Search_Exception When the file doesn`t exists or is not readable.

Normalize Token or remove it (if null is returned)

normalize(\Zend_Search_Lucene_Analysis_Token $srcToken) : \Zend_Search_Lucene_Analysis_Token
inherited_from \Zend_Search_Lucene_Analysis_TokenFilter::normalize()

Parameters

$srcToken

\Zend_Search_Lucene_Analysis_Token

Returns

\Zend_Search_Lucene_Analysis_Token

Normalize Token or remove it (if null is returned)

normalize(\Zend_Search_Lucene_Analysis_Token $srcToken) : \Zend_Search_Lucene_Analysis_Token
Inherited

Parameters

$srcToken

\Zend_Search_Lucene_Analysis_Token

Returns

\Zend_Search_Lucene_Analysis_Token

 Properties

 

Stop Words

$_stopSet : array

Default