org.apache.lucene.analysis.shingle
Class ShingleMatrixFilter.TokenSettingsCodec

java.lang.Object
  extended by org.apache.lucene.analysis.shingle.ShingleMatrixFilter.TokenSettingsCodec
Direct Known Subclasses:
ShingleMatrixFilter.OneDimensionalNonWeightedTokenSettingsCodec, ShingleMatrixFilter.SimpleThreeDimensionalTokenSettingsCodec, ShingleMatrixFilter.TwoDimensionalNonWeightedSynonymTokenSettingsCodec
Enclosing class:
ShingleMatrixFilter

public abstract static class ShingleMatrixFilter.TokenSettingsCodec
extends Object

Strategy used to code and decode meta data of the tokens from the input stream regarding how to position the tokens in the matrix, set and retreive weight, et c.


Constructor Summary
ShingleMatrixFilter.TokenSettingsCodec()
           
 
Method Summary
abstract  ShingleMatrixFilter.TokenPositioner getTokenPositioner(Token token)
          Retrieves information on how a Token is to be inserted to a ShingleMatrixFilter.Matrix.
abstract  float getWeight(Token token)
          Have this method return 1f in order to 'disable' weights.
abstract  void setTokenPositioner(Token token, ShingleMatrixFilter.TokenPositioner tokenPositioner)
          Sets information on how a Token is to be inserted to a ShingleMatrixFilter.Matrix.
abstract  void setWeight(Token token, float weight)
          Have this method do nothing in order to 'disable' weights.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShingleMatrixFilter.TokenSettingsCodec

public ShingleMatrixFilter.TokenSettingsCodec()
Method Detail

getTokenPositioner

public abstract ShingleMatrixFilter.TokenPositioner getTokenPositioner(Token token)
                                                                throws IOException
Retrieves information on how a Token is to be inserted to a ShingleMatrixFilter.Matrix.

Parameters:
token -
Returns:
ShingleMatrixFilter.TokenPositioner
Throws:
IOException

setTokenPositioner

public abstract void setTokenPositioner(Token token,
                                        ShingleMatrixFilter.TokenPositioner tokenPositioner)
Sets information on how a Token is to be inserted to a ShingleMatrixFilter.Matrix.

Parameters:
token -
tokenPositioner -

getWeight

public abstract float getWeight(Token token)
Have this method return 1f in order to 'disable' weights.

Parameters:
token -
Returns:
the weight of parameter token

setWeight

public abstract void setWeight(Token token,
                               float weight)
Have this method do nothing in order to 'disable' weights.

Parameters:
token -
weight -


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.