Package adams.flow.transformer.tokenizer
Class StanfordPTBTokenizer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.tokenizer.AbstractTokenizer
-
- adams.flow.transformer.tokenizer.StanfordPTBTokenizer
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,Serializable
public class StanfordPTBTokenizer extends AbstractTokenizer
Uses Stanford's PTBTokenizer.
For more details on the options see:
http://nlp.stanford.edu/software/tokenizer.shtml
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-tokenizer-options <java.lang.String> (property: tokenizerOptions) The tokenizer options to use. default: americanize=false,unicodeQuotes=true,unicodeEllipsis=true
- Version:
- $Revision: 11956 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected edu.stanford.nlp.process.TokenizerFactory
m_TokenizerFactory
the tokenizer factory to use.protected String
m_TokenizerOptions
the options for the tokenizer.
-
Constructor Summary
Constructors Constructor Description StanfordPTBTokenizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected List<String>
doTokenize(String str)
Performs the actual tokenization.protected edu.stanford.nlp.process.TokenizerFactory
getTokenizerFactory()
Returns the tokenizer factory to use.String
getTokenizerOptions()
Returns the tokenizer options to use.String
globalInfo()
Returns a string describing the object.protected void
reset()
Resets the scheme.void
setTokenizerOptions(String value)
Sets the tokenizer options to use.String
tokenizerOptionsTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.tokenizer.AbstractTokenizer
check, tokenize
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_TokenizerOptions
protected String m_TokenizerOptions
the options for the tokenizer.
-
m_TokenizerFactory
protected transient edu.stanford.nlp.process.TokenizerFactory m_TokenizerFactory
the tokenizer factory to use.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classadams.core.option.AbstractOptionHandler
-
setTokenizerOptions
public void setTokenizerOptions(String value)
Sets the tokenizer options to use.- Parameters:
value
- the options
-
getTokenizerOptions
public String getTokenizerOptions()
Returns the tokenizer options to use.- Returns:
- the options
-
tokenizerOptionsTipText
public String tokenizerOptionsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getTokenizerFactory
protected edu.stanford.nlp.process.TokenizerFactory getTokenizerFactory()
Returns the tokenizer factory to use.- Returns:
- the factory
-
doTokenize
protected List<String> doTokenize(String str)
Performs the actual tokenization.- Specified by:
doTokenize
in classAbstractTokenizer
- Parameters:
str
- the string to tokenize- Returns:
- the list of sentence words
-
-