DateRecognizerSinkFilter
and TeeSinkTokenFilter
instead.public class DateRecognizerSinkTokenizer extends SinkTokenizer
Token.termBuffer()
as a Date using a DateFormat
.
If the value is a Date, it will add it to the sink.
Also marks the sink token with Token.type()
equal to DATE_TYPE
AttributeSource.AttributeFactory, AttributeSource.State
Modifier and Type | Field and Description |
---|---|
static String |
DATE_TYPE
Deprecated.
|
protected DateFormat |
dateFormat
Deprecated.
|
iter, lst
Constructor and Description |
---|
DateRecognizerSinkTokenizer()
Deprecated.
Uses
DateFormat.getDateInstance() as the DateFormat object. |
DateRecognizerSinkTokenizer(DateFormat dateFormat)
Deprecated.
|
DateRecognizerSinkTokenizer(List input)
Deprecated.
Uses
DateFormat.getDateInstance() as the DateFormat object. |
DateRecognizerSinkTokenizer(List input,
DateFormat dateFormat)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Token t)
Deprecated.
Override this method to cache only certain tokens, or new tokens based
on the old tokens.
|
close, getTokens, next, reset
correctOffset, reset
end, getOnlyUseNewAPI, incrementToken, next, setOnlyUseNewAPI
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
public static final String DATE_TYPE
protected DateFormat dateFormat
public DateRecognizerSinkTokenizer()
DateFormat.getDateInstance()
as the DateFormat
object.public DateRecognizerSinkTokenizer(DateFormat dateFormat)
public DateRecognizerSinkTokenizer(List input)
DateFormat.getDateInstance()
as the DateFormat
object.input
- The input list of Tokens that are already Dates. They should be marked as type DATE_TYPE
for completenesspublic DateRecognizerSinkTokenizer(List input, DateFormat dateFormat)
input
- dateFormat
- The date format to use to try and parse the date. Note, this SinkTokenizer makes no attempt to synchronize the DateFormat objectpublic void add(Token t)
SinkTokenizer
add
in class SinkTokenizer
t
- The Token
to add to the sinkCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.