Class ShingleMatrixFilter.OneDimensionalNonWeightedTokenSettingsCodec
- java.lang.Object
-
- org.apache.lucene.analysis.shingle.ShingleMatrixFilter.TokenSettingsCodec
-
- org.apache.lucene.analysis.shingle.ShingleMatrixFilter.OneDimensionalNonWeightedTokenSettingsCodec
-
- Enclosing class:
- ShingleMatrixFilter
public static class ShingleMatrixFilter.OneDimensionalNonWeightedTokenSettingsCodec extends ShingleMatrixFilter.TokenSettingsCodec
Using this codec makes aShingleMatrixFilter
act likeShingleFilter
. It produces the most simple sort of shingles, ignoring token position increments, et c. It adds each token as a new column.
-
-
Constructor Summary
Constructors Constructor Description OneDimensionalNonWeightedTokenSettingsCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShingleMatrixFilter.TokenPositioner
getTokenPositioner(org.apache.lucene.analysis.Token token)
Retrieves information on how aToken
is to be inserted to aShingleMatrixFilter.Matrix
.float
getWeight(org.apache.lucene.analysis.Token token)
Have this method return 1f in order to 'disable' weights.void
setTokenPositioner(org.apache.lucene.analysis.Token token, ShingleMatrixFilter.TokenPositioner tokenPositioner)
Sets information on how aToken
is to be inserted to aShingleMatrixFilter.Matrix
.void
setWeight(org.apache.lucene.analysis.Token token, float weight)
Have this method do nothing in order to 'disable' weights.
-
-
-
Method Detail
-
getTokenPositioner
public ShingleMatrixFilter.TokenPositioner getTokenPositioner(org.apache.lucene.analysis.Token token) throws IOException
Description copied from class:ShingleMatrixFilter.TokenSettingsCodec
Retrieves information on how aToken
is to be inserted to aShingleMatrixFilter.Matrix
.- Specified by:
getTokenPositioner
in classShingleMatrixFilter.TokenSettingsCodec
- Returns:
ShingleMatrixFilter.TokenPositioner
- Throws:
IOException
-
setTokenPositioner
public void setTokenPositioner(org.apache.lucene.analysis.Token token, ShingleMatrixFilter.TokenPositioner tokenPositioner)
Description copied from class:ShingleMatrixFilter.TokenSettingsCodec
Sets information on how aToken
is to be inserted to aShingleMatrixFilter.Matrix
.- Specified by:
setTokenPositioner
in classShingleMatrixFilter.TokenSettingsCodec
-
getWeight
public float getWeight(org.apache.lucene.analysis.Token token)
Description copied from class:ShingleMatrixFilter.TokenSettingsCodec
Have this method return 1f in order to 'disable' weights.- Specified by:
getWeight
in classShingleMatrixFilter.TokenSettingsCodec
- Returns:
- the weight of parameter token
-
setWeight
public void setWeight(org.apache.lucene.analysis.Token token, float weight)
Description copied from class:ShingleMatrixFilter.TokenSettingsCodec
Have this method do nothing in order to 'disable' weights.- Specified by:
setWeight
in classShingleMatrixFilter.TokenSettingsCodec
-
-