org.apache.lucene.analysis.miscellaneous
Class TrimFilter
java.lang.Object
org.apache.lucene.util.AttributeSource
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.TokenFilter
org.apache.lucene.analysis.miscellaneous.TrimFilter
- All Implemented Interfaces:
- Closeable
public final class TrimFilter
- extends TokenFilter
Trims leading and trailing whitespace from Tokens in the stream.
As of Lucene 4.4, this filter does not support updateOffsets=true anymore
as it can lead to broken token streams.
Methods inherited from class org.apache.lucene.util.AttributeSource |
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString |
TrimFilter
@Deprecated
public TrimFilter(Version version,
TokenStream in,
boolean updateOffsets)
- Deprecated. Offset updates are not supported anymore as of Lucene 4.4.
- Create a new
TrimFilter
.
- Parameters:
version
- the Lucene match versionin
- the stream to consumeupdateOffsets
- whether to update offsets
TrimFilter
public TrimFilter(Version version,
TokenStream in)
- Create a new
TrimFilter
on top of in
.
incrementToken
public boolean incrementToken()
throws IOException
- Specified by:
incrementToken
in class TokenStream
- Throws:
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.