Class LuceneSmartChineseTokenizer

java.lang.Object
org.omegat.tokenizer.BaseTokenizer
org.omegat.tokenizer.LuceneSmartChineseTokenizer
All Implemented Interfaces:
ITokenizer

public class LuceneSmartChineseTokenizer extends BaseTokenizer
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.

  • Constructor Details

    • LuceneSmartChineseTokenizer

      public LuceneSmartChineseTokenizer()
  • Method Details

    • tokenizeVerbatim

      public Token[] tokenizeVerbatim(String strOrig)
      Description copied from interface: ITokenizer
      Breaks 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:
      tokenizeVerbatim in interface ITokenizer
      Overrides:
      tokenizeVerbatim in class BaseTokenizer
    • tokenizeVerbatimToStrings

      public String[] tokenizeVerbatimToStrings(String strOrig)
      Description copied from interface: ITokenizer
      Breaks 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:
      tokenizeVerbatimToStrings in interface ITokenizer
      Overrides:
      tokenizeVerbatimToStrings in class BaseTokenizer