Package org.omegat.tokenizer
Class BaseTokenizer
java.lang.Object
org.omegat.tokenizer.BaseTokenizer
- All Implemented Interfaces:
ITokenizer
- Direct Known Subclasses:
HunspellTokenizer,LuceneArabicTokenizer,LuceneArmenianTokenizer,LuceneBasqueTokenizer,LuceneBrazilianTokenizer,LuceneBulgarianTokenizer,LuceneCatalanTokenizer,LuceneCJKTokenizer,LuceneCzechTokenizer,LuceneDanishTokenizer,LuceneDutchTokenizer,LuceneEnglishTokenizer,LuceneFinnishTokenizer,LuceneFrenchTokenizer,LuceneGalicianTokenizer,LuceneGermanTokenizer,LuceneGreekTokenizer,LuceneHindiTokenizer,LuceneHungarianTokenizer,LuceneIndonesianTokenizer,LuceneIrishTokenizer,LuceneItalianTokenizer,LuceneJapaneseTokenizer,LuceneLatvianTokenizer,LuceneNorwegianTokenizer,LucenePersianTokenizer,LucenePolishTokenizer,LucenePortugueseTokenizer,LuceneRomanianTokenizer,LuceneRussianTokenizer,LuceneSmartChineseTokenizer,LuceneSpanishTokenizer,LuceneSwedishTokenizer,LuceneThaiTokenizer,LuceneTurkishTokenizer
Base class for Lucene-based tokenizers.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.omegat.tokenizer.ITokenizer
ITokenizer.StemmingMode -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Return an array of language strings (xx-yy) indicating the tokenizer's supported languages.Token[]tokenizeVerbatim(String strOrig) Breaks a string into tokens.String[]Breaks a string into strings.Token[]tokenizeWords(String strOrig, ITokenizer.StemmingMode stemmingMode) Breaks a string into word-only tokens.String[]tokenizeWordsToStrings(String str, ITokenizer.StemmingMode stemmingMode) Breaks a string into word-only strings.
-
Field Details
-
TOKENIZER_DEBUG_PROVIDER
-
-
Constructor Details
-
BaseTokenizer
public BaseTokenizer()
-
-
Method Details
-
tokenizeWords
Description copied from interface:ITokenizerBreaks a string into word-only tokens. Numbers, tags, and other non-word tokens are NOT included in the result. Stemming can be used depending on the suppliedITokenizer.StemmingMode.This method is used to find fuzzy matches and glossary entries.
Results can be cached for better performance.
- Specified by:
tokenizeWordsin interfaceITokenizer
-
tokenizeWordsToStrings
Description copied from interface:ITokenizerBreaks a string into word-only strings. Numbers, tags, and other non-word tokens are NOT included in the result. Stemming can be used depending on the suppliedITokenizer.StemmingMode.When stemming is used, both the original word and its stem may be included in the results, if they differ. (The stem will come first.)
This method used for dictionary lookup.
Results are not cached.
- Specified by:
tokenizeWordsToStringsin interfaceITokenizer
-
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
-
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
-
getSupportedLanguages
Description copied from interface:ITokenizerReturn an array of language strings (xx-yy) indicating the tokenizer's supported languages. Meant for tokenizers for which the supported languages can only be determined at runtime, like theHunspellTokenizer.Indicate that this should be used by setting the
Tokenizerannotation to contain onlyTokenizer.DISCOVER_AT_RUNTIME.- Specified by:
getSupportedLanguagesin interfaceITokenizer
-