public final class IcuTransformTokenFilter
extends org.apache.lucene.analysis.TokenFilter
TokenFilter
that transforms text with ICU.
ICU provides text-transformation functionality via its Transliteration API. Although script conversion is its most common use, a Transliterator can actually perform a more general class of tasks. In fact, Transliterator defines a very general API which specifies only that a segment of the input text is replaced by new text. The particulars of this conversion are determined entirely by subclasses of Transliterator.
Some useful transformations for search are built-in:
Example usage:
stream = new ICUTransformFilter(stream, Transliterator.getInstance("Traditional-Simplified"));
Constructor and Description |
---|
IcuTransformTokenFilter(org.apache.lucene.analysis.TokenStream input,
com.ibm.icu.text.Transliterator transliterator)
Create a new IcuTransformFilter that transforms text on the given stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
int |
hashCode() |
boolean |
incrementToken() |
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
public IcuTransformTokenFilter(org.apache.lucene.analysis.TokenStream input, com.ibm.icu.text.Transliterator transliterator)
input
- TokenStream
to filter.transliterator
- Transliterator to transform the text.public boolean incrementToken() throws java.io.IOException
incrementToken
in class org.apache.lucene.analysis.TokenStream
java.io.IOException
public boolean equals(java.lang.Object object)
equals
in class org.apache.lucene.util.AttributeSource
public int hashCode()
hashCode
in class org.apache.lucene.util.AttributeSource