Class JapaneseCompletionFilter
- All Implemented Interfaces:
Closeable,AutoCloseable,Unwrappable<TokenStream>
TokenFilter that adds Japanese romanized tokens to the term
attribute. Also, this keeps original tokens (surface forms). Main usage of this filter is Query
Auto-Completion.
Supported romanization systems: (modified) Hepburn-shiki, Kunrei-shiki (Nihon-shiki) and Wāpuro shiki.
This does not strictly comply with the romanization systems listed above, but tries to cover possible keystroke supported by various Input Methods. e.g.: Circumflex / Macron representing Chōonpu (長音符) are not supported.
The romanization behaviour changes according to its JapaneseCompletionFilter.Mode. The default mode is JapaneseCompletionFilter.Mode.INDEX.
Note: This filter must be applied AFTER half-width and full-width normalization. Please ensure
that a width normalizer such as CJKWidthCharFilter or
CJKWidthFilter is included in your analysis chain. IF THE
WIDTH NORMALIZATION IS NOT PERFORMED, THIS DOES NOT WORK AS EXPECTED. See also: JapaneseCompletionAnalyzer.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
AttributeSource.State -
Field Summary
FieldsFields inherited from class org.apache.lucene.analysis.TokenFilter
inputFields inherited from class org.apache.lucene.analysis.TokenStream
DEFAULT_TOKEN_ATTRIBUTE_FACTORY -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newJapaneseCompletionFilterwith default configurationsCreates a newJapaneseCompletionFilter -
Method Summary
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end, unwrapMethods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
-
Field Details
-
DEFAULT_MODE
-
-
Constructor Details
-
JapaneseCompletionFilter
Creates a newJapaneseCompletionFilterwith default configurations -
JapaneseCompletionFilter
Creates a newJapaneseCompletionFilter
-
-
Method Details
-
reset
- Overrides:
resetin classTokenFilter- Throws:
IOException
-
incrementToken
- Specified by:
incrementTokenin classTokenStream- Throws:
IOException
-