org.apache.lucene.analysis.shingle

## 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 java.lang.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 and Description
    `TokenSettingsCodec()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ShingleMatrixFilter.TokenPositioner` | `getTokenPositioner(org.apache.lucene.analysis.Token token)` Retrieves information on how a `Token` is to be inserted to a `ShingleMatrixFilter.Matrix`.
    `abstract float` | `getWeight(org.apache.lucene.analysis.Token token)` Have this method return 1f in order to 'disable' weights.
    `abstract void` | `setTokenPositioner(org.apache.lucene.analysis.Token token, ShingleMatrixFilter.TokenPositioner tokenPositioner)` Sets information on how a `Token` is to be inserted to a `ShingleMatrixFilter.Matrix`.
    `abstract void` | `setWeight(org.apache.lucene.analysis.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

    - #### TokenSettingsCodec

          public TokenSettingsCodec()

  - ### Method Detail

    - #### getTokenPositioner

          public abstract ShingleMatrixFilter.TokenPositioner getTokenPositioner(org.apache.lucene.analysis.Token token)
                                                                          throws java.io.IOException

      Retrieves information on how a `Token` is to be inserted to a `ShingleMatrixFilter.Matrix`.
      Parameters:
        `token` -
      Returns:
        `ShingleMatrixFilter.TokenPositioner`
      Throws:
        `java.io.IOException`

    - #### setTokenPositioner

          public abstract void setTokenPositioner(org.apache.lucene.analysis.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(org.apache.lucene.analysis.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(org.apache.lucene.analysis.Token token,
                                         float weight)

      Have this method do nothing in order to 'disable' weights.
      Parameters:
        `token` -
        `weight` -

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