Class JapaneseIterationMarkCharFilter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Normalize kana iteration marks by defaultstatic final boolean
Normalize kanji iteration marks by defaultFields inherited from class org.apache.lucene.analysis.CharFilter
input
-
Constructor Summary
ConstructorDescriptionConstructor.JapaneseIterationMarkCharFilter
(Reader input, boolean normalizeKanji, boolean normalizeKana) Constructor -
Method Summary
Methods inherited from class org.apache.lucene.analysis.CharFilter
close, correctOffset
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
Field Details
-
NORMALIZE_KANJI_DEFAULT
public static final boolean NORMALIZE_KANJI_DEFAULTNormalize kanji iteration marks by default- See Also:
-
NORMALIZE_KANA_DEFAULT
public static final boolean NORMALIZE_KANA_DEFAULTNormalize kana iteration marks by default- See Also:
-
-
Constructor Details
-
JapaneseIterationMarkCharFilter
Constructor. Normalizes both kanji and kana iteration marks by default.- Parameters:
input
- char stream
-
JapaneseIterationMarkCharFilter
Constructor- Parameters:
input
- char streamnormalizeKanji
- indicates whether kanji iteration marks should be normalizednormalizeKana
- indicates whether kana iteration marks should be normalized
-
-
Method Details
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
read
- Overrides:
read
in classReader
- Throws:
IOException
-
correct
protected int correct(int currentOff) - Specified by:
correct
in classCharFilter
-