org.terrier.terms
Class SkipTermPipeline

java.lang.Object
  extended by org.terrier.terms.SkipTermPipeline
All Implemented Interfaces:
TermPipeline

public class SkipTermPipeline
extends java.lang.Object
implements TermPipeline

Class that identified tokens which should not be passed down the entire term pipeline, and instead passed onto a specified stage instead. Tokens are autmatically lowercased if lowercase is set (as it is by default). If no tokens are specified, then no tokens are omitted from the term pipeline.

Properties

Since:
2.2
Author:
Rodrygo Santos and Craig Macdonald

Constructor Summary
SkipTermPipeline(TermPipeline _next, TermPipeline _last)
          Instantiate this object, using properties to define tokens.
SkipTermPipeline(TermPipeline _next, TermPipeline _last, java.lang.String[] _skipTokens)
          Instantiate this object.
 
Method Summary
 void processTerm(java.lang.String term)
          Processes this token.
 boolean reset()
          Implements the default operation for all TermPipeline subclasses; By default do nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkipTermPipeline

public SkipTermPipeline(TermPipeline _next,
                        TermPipeline _last)
Instantiate this object, using properties to define tokens. Skip tokens are specified as a comma delimited list, using the termpipelines.skip property. Terms are lowercased if lowercase is set (as it is by default).


SkipTermPipeline

public SkipTermPipeline(TermPipeline _next,
                        TermPipeline _last,
                        java.lang.String[] _skipTokens)
Instantiate this object. Terms in skipTokens will be passed to the last term pipeline object instead of the next.

Method Detail

processTerm

public void processTerm(java.lang.String term)
Processes this token. If is a specified token, then passes it to the last stage in the pipgeline, instead of onto the next one.

Specified by:
processTerm in interface TermPipeline
Parameters:
term -

reset

public boolean reset()
Implements the default operation for all TermPipeline subclasses; By default do nothing. This method should be overrided by any TermPipeline that want to implements doc/query oriented lifecycle.

Specified by:
reset in interface TermPipeline
Returns:
return how the reset has gone


Terrier 3.5. Copyright © 2004-2011 University of Glasgow