public class JapaneseIterationMarkCharFilter extends CharFilter
Sequences of iteration marks are supported. In case an illegal sequence of iteration marks is encountered, the implementation emits the illegal source character as-is without considering its script. For example, with input "?ゝ", we get "??" even though the question mark isn't hiragana.
Note that a full stop punctuation character "。" (U+3002) can not be iterated (see below). Iteration marks themselves can be emitted in case they are illegal, i.e. if they go back past the beginning of the character stream.
The implementation buffers input until a full stop punctuation character (U+3002) or EOF is reached in order to not keep a copy of the character stream in memory. Vertical iteration marks, which are even rarer than horizontal iteration marks in contemporary Japanese, are unsupported.
Modifier and Type | Field and Description |
---|---|
static boolean |
NORMALIZE_KANA_DEFAULT
Normalize kana iteration marks by default
|
static boolean |
NORMALIZE_KANJI_DEFAULT
Normalize kanji iteration marks by default
|
input
Constructor and Description |
---|
JapaneseIterationMarkCharFilter(Reader input)
Constructor.
|
JapaneseIterationMarkCharFilter(Reader input,
boolean normalizeKanji,
boolean normalizeKana)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected int |
correct(int currentOff) |
int |
read() |
int |
read(char[] buffer,
int offset,
int length) |
close, correctOffset
public static final boolean NORMALIZE_KANJI_DEFAULT
public static final boolean NORMALIZE_KANA_DEFAULT
public JapaneseIterationMarkCharFilter(Reader input)
input
- char streampublic JapaneseIterationMarkCharFilter(Reader input, boolean normalizeKanji, boolean normalizeKana)
input
- char streamnormalizeKanji
- indicates whether kanji iteration marks should be normalizednormalizeKana
- indicates whether kana iteration marks should be normalizedpublic int read(char[] buffer, int offset, int length) throws IOException
read
in class Reader
IOException
public int read() throws IOException
read
in class Reader
IOException
protected int correct(int currentOff)
correct
in class CharFilter
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.