Package org.apache.lucene.tests.analysis
Class MockGraphTokenFilter
java.lang.Object
org.apache.lucene.util.AttributeSource
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.TokenFilter
org.apache.lucene.tests.analysis.LookaheadTokenFilter<LookaheadTokenFilter.Position>
org.apache.lucene.tests.analysis.MockGraphTokenFilter
- All Implemented Interfaces:
Closeable,AutoCloseable,Unwrappable<TokenStream>
Randomly inserts overlapped (posInc=0) tokens with posLength sometimes > 1. The chain must
have an OffsetAttribute.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.tests.analysis.LookaheadTokenFilter
LookaheadTokenFilter.PositionNested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
AttributeSource.State -
Field Summary
Fields inherited from class org.apache.lucene.tests.analysis.LookaheadTokenFilter
end, inputPos, offsetAtt, outputPos, posIncAtt, positions, posLenAttFields inherited from class org.apache.lucene.analysis.TokenFilter
inputFields inherited from class org.apache.lucene.analysis.TokenStream
DEFAULT_TOKEN_ATTRIBUTE_FACTORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis is called when all input tokens leaving a given position have been returned.voidclose()booleanprotected LookaheadTokenFilter.Positionvoidreset()Methods inherited from class org.apache.lucene.tests.analysis.LookaheadTokenFilter
insertToken, nextToken, peekTokenMethods inherited from class org.apache.lucene.analysis.TokenFilter
end, unwrapMethods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
-
Constructor Details
-
MockGraphTokenFilter
-
-
Method Details
-
newPosition
- Specified by:
newPositionin classLookaheadTokenFilter<LookaheadTokenFilter.Position>
-
afterPosition
Description copied from class:LookaheadTokenFilterThis is called when all input tokens leaving a given position have been returned. Override this and call insertToken and then set whichever token's attributes you want, if you want to inject a token starting from this position.- Overrides:
afterPositionin classLookaheadTokenFilter<LookaheadTokenFilter.Position>- Throws:
IOException
-
reset
- Overrides:
resetin classLookaheadTokenFilter<LookaheadTokenFilter.Position>- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTokenFilter- Throws:
IOException
-
incrementToken
- Specified by:
incrementTokenin classTokenStream- Throws:
IOException
-