API Documentation

Search/Lucene/Analysis/TokenFilter/StopWords.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Analysis
version
$Id: StopWords.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Search_Lucene_Analysis_TokenFilter_StopWords

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Search_Lucene_Analysis_TokenFilter_StopWords

Extends from
Zend_Search_Lucene_Analysis_TokenFilter
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Search_Lucene
subpackage
Analysis
Properties
$_stopSet
Methods
__construct
normalize
loadFromFile

Description

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.

Properties

$_stopSet

array $_stopSet = ''

Stop Words

Details

$_stopSet
array
visibility
private
default
final
false
static
false

Methods

__construct

__construct( array $stopwords = array ) :

Constructs new instance of this filter.

Arguments
$stopwords
array
array (set) of words that will be filtered out
Details
visibility
public
final
false
static
false

loadFromFile

loadFromFile( string $filepath = null ) :

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

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

Arguments
$filepath
string
full path for text file with stopwords
Details
visibility
public
final
false
static
false
throws
When the file doesn`t exists or is not readable.

normalize

normalize( Zend_Search_Lucene_Analysis_Token $srcToken ) : Zend_Search_Lucene_Analysis_Token

Normalize Token or remove it (if null is returned)

Arguments
$srcToken
Zend_Search_Lucene_Analysis_Token
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.