Class ShingleMatrixFilter.TokenSettingsCodec
- java.lang.Object
-
- 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
Constructors Constructor Description TokenSettingsCodec()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract ShingleMatrixFilter.TokenPositioner
getTokenPositioner(Token token)
Retrieves information on how aToken
is to be inserted to aShingleMatrixFilter.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 aToken
is to be inserted to aShingleMatrixFilter.Matrix
.abstract void
setWeight(Token token, float weight)
Have this method do nothing in order to 'disable' weights.
-
-
-
Method Detail
-
getTokenPositioner
public abstract ShingleMatrixFilter.TokenPositioner getTokenPositioner(Token token) throws IOException
Retrieves information on how aToken
is to be inserted to aShingleMatrixFilter.Matrix
.- Parameters:
token
-- Returns:
ShingleMatrixFilter.TokenPositioner
- Throws:
IOException
-
setTokenPositioner
public abstract void setTokenPositioner(Token token, ShingleMatrixFilter.TokenPositioner tokenPositioner)
Sets information on how aToken
is to be inserted to aShingleMatrixFilter.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
-
-
-