public abstract static class TokenizerBase.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected CharacterDefinitions |
characterDefinitions |
protected ConnectionCosts |
connectionCosts |
protected DoubleArrayTrie |
doubleArrayTrie |
protected InsertedDictionary |
insertedDictionary |
protected TokenizerBase.Mode |
mode |
protected int |
partOfSpeechFeature |
protected java.util.List<java.lang.Integer> |
penalties |
protected int |
readingFeature |
protected ResourceResolver |
resolver |
protected boolean |
split |
protected TokenFactory |
tokenFactory |
protected TokenInfoDictionary |
tokenInfoDictionary |
protected int |
totalFeatures |
protected UnknownDictionary |
unknownDictionary |
protected UserDictionary |
userDictionary |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract <T extends TokenizerBase> |
build()
Creates a Tokenizer instance defined by this Builder
|
protected void |
loadDictionaries() |
TokenizerBase.Builder |
userDictionary(java.io.InputStream input)
Sets an optional user dictionary as an input stream
|
TokenizerBase.Builder |
userDictionary(java.lang.String filename)
Sets an optional user dictionary filename
|
protected DoubleArrayTrie doubleArrayTrie
protected ConnectionCosts connectionCosts
protected TokenInfoDictionary tokenInfoDictionary
protected UnknownDictionary unknownDictionary
protected CharacterDefinitions characterDefinitions
protected InsertedDictionary insertedDictionary
protected UserDictionary userDictionary
protected TokenizerBase.Mode mode
protected boolean split
protected java.util.List<java.lang.Integer> penalties
protected int totalFeatures
protected int readingFeature
protected int partOfSpeechFeature
protected ResourceResolver resolver
protected TokenFactory tokenFactory
protected void loadDictionaries()
public abstract <T extends TokenizerBase> T build()
T
- token typepublic TokenizerBase.Builder userDictionary(java.io.InputStream input) throws java.io.IOException
The inpuut stream provided is not closed by this method
input
- user dictionary as an input streamjava.io.IOException
- if an error occurs when reading the user dictionarypublic TokenizerBase.Builder userDictionary(java.lang.String filename) throws java.io.IOException
filename
- user dictionary filenamejava.io.IOException
- if an error occurs when reading the user dictionary