Package org.omegat.tokenizer
Class LuceneSmartChineseTokenizer
java.lang.Object
org.omegat.tokenizer.BaseTokenizer
org.omegat.tokenizer.LuceneSmartChineseTokenizer
- All Implemented Interfaces:
ITokenizer
LuceneSmartChineseTokenizer is a tokenizer class for handling Chinese text processing
using the SmartChineseAnalyzer or HMMChineseTokenizer from the Lucene library.
This class is specifically designed for scenarios requiring tokenization of Chinese
text, either with or without stemming and stop word filtering.
This tokenizer is intended to tokenize input strings either by code points or by utilizing Lucene's token stream processing. It overrides methods to cater to verbatim tokenization needs, addressing issues with punctuation replacement in the SmartChineseAnalyzer when dealing with verbatim scenarios.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.omegat.tokenizer.ITokenizer
ITokenizer.StemmingMode -
Field Summary
Fields inherited from class org.omegat.tokenizer.BaseTokenizer
TOKENIZER_DEBUG_PROVIDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionToken[]tokenizeVerbatim(String strOrig) Breaks a string into tokens.String[]tokenizeVerbatimToStrings(String strOrig) Breaks a string into strings.Methods inherited from class org.omegat.tokenizer.BaseTokenizer
getSupportedLanguages, tokenizeWords, tokenizeWordsToStrings
-
Constructor Details
-
LuceneSmartChineseTokenizer
public LuceneSmartChineseTokenizer()
-
-
Method Details
-
tokenizeVerbatim
Description copied from interface:ITokenizerBreaks a string into tokens. Numbers, tags, and other non-word tokens are included in the result. Stemming is NOT used.This method is used to mark string differences in the UI and to tune similarity.
Results are not cached.
- Specified by:
tokenizeVerbatimin interfaceITokenizer- Overrides:
tokenizeVerbatimin classBaseTokenizer
-
tokenizeVerbatimToStrings
Description copied from interface:ITokenizerBreaks a string into strings. Numbers, tags, and other non-word tokens are included in the result. Stemming is NOT used.This method is used to mark string differences in the UI and for debugging purposes.
Results are not cached.
- Specified by:
tokenizeVerbatimToStringsin interfaceITokenizer- Overrides:
tokenizeVerbatimToStringsin classBaseTokenizer
-