public final class TypeAsSynonymFilter extends TokenFilter
TypeAttribute.type()
as a synonym,
i.e. another token at the same position, optionally with a specified prefix prepended, optionally
transfering flags, and optionally ignoring some types. See TypeAsSynonymFilterFactory
for
full details.AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
TypeAsSynonymFilter(TokenStream input) |
TypeAsSynonymFilter(TokenStream input,
String prefix) |
TypeAsSynonymFilter(TokenStream input,
String prefix,
Set<String> ignore,
int synFlagsMask) |
Modifier and Type | Method and Description |
---|---|
boolean |
incrementToken() |
void |
reset() |
close, end
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
public TypeAsSynonymFilter(TokenStream input)
public TypeAsSynonymFilter(TokenStream input, String prefix)
input
- input tokenstreamprefix
- Prepend this string to every token type emitted as token text.
If null, nothing will be prepended.public TypeAsSynonymFilter(TokenStream input, String prefix, Set<String> ignore, int synFlagsMask)
input
- input tokenstreamprefix
- Prepend this string to every token type emitted as token text.
If null, nothing will be prepended.ignore
- types to ignore (and not convert to a synonym)synFlagsMask
- a mask to control what flags are propagated to the synonym.public boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public void reset() throws IOException
reset
in class TokenFilter
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.