The ShingleMatrixFilter type exposes the following members.

Constructors

  NameDescription
Public methodShingleMatrixFilter(TokenStream, Int32, Int32)
Creates a shingle filter using default settings. See ShingleMatrixFilter.DefaultSpacerCharacter, ShingleMatrixFilter.IgnoringSinglePrefixOrSuffixShingleByDefault, and ShingleMatrixFilter.DefaultSettingsCodec
Public methodShingleMatrixFilter(TokenStream, Int32, Int32, Nullable<(Of <<'(Char>)>>))
Creates a shingle filter using default settings. See IgnoringSinglePrefixOrSuffixShingleByDefault, and DefaultSettingsCodec
Public methodShingleMatrixFilter(TokenStream, Int32, Int32, Nullable<(Of <<'(Char>)>>), Boolean)
Creates a shingle filter using the default {@link TokenSettingsCodec}. See DefaultSettingsCodec
Public methodShingleMatrixFilter(Matrix, Int32, Int32, Char, Boolean, TokenSettingsCodec)
Creates a shingle filter based on a user defined matrix. The filter /will/ delete columns from the input matrix! You will not be able to reset the filter if you used this constructor. todo: don't touch the matrix! use a bool, set the input stream to null or something, and keep track of where in the matrix we are at.
Public methodShingleMatrixFilter(TokenStream, Int32, Int32, Nullable<(Of <<'(Char>)>>), Boolean, TokenSettingsCodec)
Creates a shingle filter with ad hoc parameter settings.

Methods

  NameDescription
Public methodAddAttribute
The caller must pass in a Class<? extends Attribute> value. This method first checks if an instance of that class is already in this AttributeSource and returns it. Otherwise a new instance is created, added to this AttributeSource and returned. Signature for Java 1.5:
CopyC#
public <T extends Attribute> T addAttribute(Class<T>)
(Inherited from AttributeSource.)
Public methodAddAttributeImpl
Adds a custom AttributeImpl instance with one or more Attribute interfaces.
(Inherited from AttributeSource.)
Public methodCalculateShingleWeight
Evaluates the new shingle token weight. for (shingle part token in shingle) weight += shingle part token weight * (1 / sqrt(all shingle part token weights summed)) This algorithm gives a slightly greater score for longer shingles and is rather penalising to great shingle token part weights.
Public methodCaptureState
Captures the state of all Attributes. The return value can be passed to {@link #restoreState} to restore the state of this or another AttributeSource.
(Inherited from AttributeSource.)
Public methodClearAttributes
Resets all Attributes in this AttributeSource by calling {@link AttributeImpl#Clear()} on each Attribute implementation.
(Inherited from AttributeSource.)
Public methodCloneAttributes
Performs a clone of all {@link AttributeImpl} instances returned in a new AttributeSource instance. This method can be used to e.g. create another TokenStream with exactly the same attributes (using {@link #AttributeSource(AttributeSource)})
(Inherited from AttributeSource.)
Public methodClose
Releases resources associated with this stream.
(Inherited from TokenStream.)
Public methodEnd
This method is called by the consumer after the last token has been consumed, after {@link #IncrementToken()} returned
CopyC#
false
(using the new
CopyC#
TokenStream
API). Streams implementing the old API should upgrade to use this feature.

This method can be used to perform any end-of-stream operations, such as setting the final offset of a stream. The final offset of a stream might differ from the offset of the last token eg in case one or more whitespaces followed after the last token, but a {@link WhitespaceTokenizer} was used.

(Inherited from TokenStream.)
Public methodEquals (Inherited from AttributeSource.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAttribute
The caller must pass in a Class<? extends Attribute> value. Returns the instance of the passed in Attribute contained in this AttributeSource Signature for Java 1.5:
CopyC#
public <T extends Attribute> T getAttribute(Class<T>)
(Inherited from AttributeSource.)
Public methodGetAttributeClassesIterator
Returns a new iterator that iterates the attribute classes in the same order they were added in. Signature for Java 1.5:
CopyC#
public Iterator<Class<? extends Attribute>> getAttributeClassesIterator()
Note that this return value is different from Java in that it enumerates over the values and not the keys
(Inherited from AttributeSource.)
Public methodGetAttributeFactory
returns the used AttributeFactory.
(Inherited from AttributeSource.)
Public methodGetAttributeImplsIterator
Returns a new iterator that iterates all unique Attribute implementations. This iterator may contain less entries that {@link #getAttributeClassesIterator}, if one instance implements more than one Attribute interface. Signature for Java 1.5:
CopyC#
public Iterator<AttributeImpl> getAttributeImplsIterator()
(Inherited from AttributeSource.)
Public methodGetHashCode (Inherited from AttributeSource.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasAttribute
The caller must pass in a Class<? extends Attribute> value. Returns true, iff this AttributeSource contains the passed-in Attribute. Signature for Java 1.5:
CopyC#
public boolean hasAttribute(Class<? extends Attribute>)
(Inherited from AttributeSource.)
Public methodHasAttributes
Returns true, iff this AttributeSource has any attributes
(Inherited from AttributeSource.)
Public methodIncrementToken (Overrides TokenStream..::..IncrementToken()()()().)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNext()()()() Obsolete.
Deprecated: Will be removed in Lucene 3.0. This method is final, as it should not be overridden. Delegates to the backwards compatibility layer.
(Overrides TokenStream..::..Next()()()().)
Public methodNext(Token) Obsolete.
Deprecated: Will be removed in Lucene 3.0. This method is final, as it should not be overridden. Delegates to the backwards compatibility layer.
(Overrides TokenStream..::..Next(Token).)
Public methodReset (Overrides TokenStream..::..Reset()()()().)
Public methodRestoreState
Restores this state by copying the values of all attribute implementations that this state contains into the attributes implementations of the targetStream. The targetStream must contain a corresponding instance for each argument contained in this state (e.g. it is not possible to restore the state of an AttributeSource containing a TermAttribute into a AttributeSource using a Token instance as implementation). Note that this method does not affect attributes of the targetStream that are not contained in this state. In other words, if for example the targetStream contains an OffsetAttribute, but this state doesn't, then the value of the OffsetAttribute remains unchanged. It might be desirable to reset its value to the default, in which case the caller should first call {@link TokenStream#ClearAttributes()} on the targetStream.
(Inherited from AttributeSource.)
Public methodToString (Inherited from AttributeSource.)
Public methodUpdateToken
Final touch of a shingle token before it is passed on to the consumer from method {@link #next(org.apache.lucene.analysis.Token)}. Calculates and sets type, flags, position increment, start/end offsets and weight.

Fields

Properties

See Also