public final class PatternReplaceFilter
extends org.apache.lucene.analysis.TokenFilter
Note: Depending on the input and the pattern used and the input TokenStream, this TokenFilter may produce Tokens whose text is the empty string.
Pattern| Constructor and Description |
|---|
PatternReplaceFilter(org.apache.lucene.analysis.TokenStream in,
Pattern p,
String replacement,
boolean all)
Constructs an instance to replace either the first, or all occurances
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
incrementToken() |
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toStringpublic PatternReplaceFilter(org.apache.lucene.analysis.TokenStream in,
Pattern p,
String replacement,
boolean all)
in - the TokenStream to processp - the patterm to apply to each Tokenreplacement - the "replacement string" to substitute, if null a
blank string will be used. Note that this is not the literal
string that will be used, '$' and '\' have special meaning.all - if true, all matches will be replaced otherwise just the first match.Matcher.quoteReplacement(java.lang.String)public boolean incrementToken()
throws IOException
incrementToken in class org.apache.lucene.analysis.TokenStreamIOExceptionCopyright © 2006–2014 The Apache Software Foundation. All rights reserved.