public class MappingCharFilter extends BaseCharFilter
CharFilter that applies the mappings
contained in a NormalizeCharMap to the character
stream, and correcting the resulting changes to the
offsets. Matching is greedy (longest pattern matching at
a given point wins). Replacement is allowed to be the
empty string.| Modifier and Type | Field and Description |
|---|---|
private RollingCharBuffer |
buffer |
private java.util.Map<java.lang.Character,FST.Arc<CharsRef>> |
cachedRootArcs |
private FST.BytesReader |
fstReader |
private int |
inputOff |
private FST<CharsRef> |
map |
private Outputs<CharsRef> |
outputs |
private CharsRef |
replacement |
private int |
replacementPointer |
private FST.Arc<CharsRef> |
scratchArc |
input| Constructor and Description |
|---|
MappingCharFilter(NormalizeCharMap normMap,
java.io.Reader in)
Default constructor that takes a
Reader. |
| Modifier and Type | Method and Description |
|---|---|
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
void |
reset() |
addOffCorrectMap, correct, getLastCumulativeDiffclose, correctOffsetprivate final FST.BytesReader fstReader
private final RollingCharBuffer buffer
private CharsRef replacement
private int replacementPointer
private int inputOff
public MappingCharFilter(NormalizeCharMap normMap, java.io.Reader in)
Reader.public void reset()
throws java.io.IOException
reset in class java.io.Readerjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOException