Class DateRecognizerSinkFilter
Attempts to parse the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer as a Date using either the TryParse(string, IFormatProvider, DateTimeStyles, out DateTime) or TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) methods. If a format is passed, TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) will be used, and the format must strictly match one of the specified formats as specified in the MSDN documentation. If the value is a Date, it will add it to the sink.
Inherited Members
Namespace: Lucene.Net.Analysis.Sinks
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class DateRecognizerSinkFilter : TeeSinkTokenFilter.SinkFilter
Constructors
DateRecognizerSinkFilter()
Creates a new instance of DateRecognizerSinkFilter using the current culture and None. Loosely matches standard DateTime formats using TryParse(string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter()
DateRecognizerSinkFilter(IFormatProvider)
Creates a new instance of DateRecognizerSinkFilter using the supplied culture and None. Loosely matches standard DateTime formats using TryParse(string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(IFormatProvider culture)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | culture | An object that supplies culture-specific format information |
DateRecognizerSinkFilter(IFormatProvider, DateTimeStyles)
Creates a new instance of DateRecognizerSinkFilter using the supplied culture and DateTimeStyles. Loosely matches standard DateTime formats using TryParse(string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(IFormatProvider culture, DateTimeStyles style)
Parameters
Type | Name | Description |
---|---|---|
IFormatProvider | culture | An object that supplies culture-specific format information |
DateTimeStyles | style | A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is None |
DateRecognizerSinkFilter(string)
Creates a new instance of DateRecognizerSinkFilter using the current culture and None. Strictly matches the supplied DateTime formats using TryParseExact(string, string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format | The allowable format of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, it must match the format of the date exactly to get a match. |
DateRecognizerSinkFilter(string, IFormatProvider)
Creates a new instance of DateRecognizerSinkFilter using the supplied format, culture and None. Strictly matches the supplied DateTime formats using TryParseExact(string, string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string format, IFormatProvider culture)
Parameters
Type | Name | Description |
---|---|---|
string | format | The allowable format of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, it must match the format of the date exactly to get a match. |
IFormatProvider | culture | An object that supplies culture-specific format information |
DateRecognizerSinkFilter(string, IFormatProvider, DateTimeStyles)
Creates a new instance of DateRecognizerSinkFilter using the supplied format, culture and DateTimeStyles. Strictly matches the supplied DateTime formats using TryParseExact(string, string, IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string format, IFormatProvider culture, DateTimeStyles style)
Parameters
Type | Name | Description |
---|---|---|
string | format | The allowable format of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, it must match the format of the date exactly to get a match. |
IFormatProvider | culture | An object that supplies culture-specific format information |
DateTimeStyles | style | A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is None |
DateRecognizerSinkFilter(string[])
Creates a new instance of DateRecognizerSinkFilter using the current culture and None. Strictly matches the supplied DateTime formats using TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string[] formats)
Parameters
Type | Name | Description |
---|---|---|
string[] | formats | An array of allowable formats of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, one of them must match the format of the date exactly to get a match. |
DateRecognizerSinkFilter(string[], IFormatProvider)
Creates a new instance of DateRecognizerSinkFilter using the supplied formats, culture and None. Strictly matches the supplied DateTime formats using TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string[] formats, IFormatProvider culture)
Parameters
Type | Name | Description |
---|---|---|
string[] | formats | An array of allowable formats of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, one of them must match the format of the date exactly to get a match. |
IFormatProvider | culture | An object that supplies culture-specific format information |
DateRecognizerSinkFilter(string[], IFormatProvider, DateTimeStyles)
Creates a new instance of DateRecognizerSinkFilter using the supplied formats, culture and DateTimeStyles. Strictly matches the supplied DateTime formats using TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime).
Declaration
public DateRecognizerSinkFilter(string[] formats, IFormatProvider culture, DateTimeStyles style)
Parameters
Type | Name | Description |
---|---|---|
string[] | formats | An array of allowable formats of the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer. If supplied, one of them must match the format of the date exactly to get a match. |
IFormatProvider | culture | An object that supplies culture-specific format information |
DateTimeStyles | style | A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is None |
Fields
m_culture
Attempts to parse the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer as a Date using either the TryParse(string, IFormatProvider, DateTimeStyles, out DateTime) or TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) methods. If a format is passed, TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) will be used, and the format must strictly match one of the specified formats as specified in the MSDN documentation. If the value is a Date, it will add it to the sink.
Declaration
protected IFormatProvider m_culture
Field Value
Type | Description |
---|---|
IFormatProvider |
m_formats
Attempts to parse the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer as a Date using either the TryParse(string, IFormatProvider, DateTimeStyles, out DateTime) or TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) methods. If a format is passed, TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) will be used, and the format must strictly match one of the specified formats as specified in the MSDN documentation. If the value is a Date, it will add it to the sink.
Declaration
protected string[] m_formats
Field Value
Type | Description |
---|---|
string[] |
m_style
Attempts to parse the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer as a Date using either the TryParse(string, IFormatProvider, DateTimeStyles, out DateTime) or TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) methods. If a format is passed, TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) will be used, and the format must strictly match one of the specified formats as specified in the MSDN documentation. If the value is a Date, it will add it to the sink.
Declaration
protected DateTimeStyles m_style
Field Value
Type | Description |
---|---|
DateTimeStyles |
m_termAtt
Attempts to parse the Lucene.Net.Analysis.TokenAttributes.ICharTermAttribute.Buffer as a Date using either the TryParse(string, IFormatProvider, DateTimeStyles, out DateTime) or TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) methods. If a format is passed, TryParseExact(string, string[], IFormatProvider, DateTimeStyles, out DateTime) will be used, and the format must strictly match one of the specified formats as specified in the MSDN documentation. If the value is a Date, it will add it to the sink.
Declaration
protected ICharTermAttribute m_termAtt
Field Value
Type | Description |
---|---|
ICharTermAttribute |
Methods
Accept(AttributeSource)
Returns true, iff the current state of the passed-in Lucene.Net.Util.AttributeSource shall be stored in the sink.
Declaration
public override bool Accept(AttributeSource source)
Parameters
Type | Name | Description |
---|---|---|
AttributeSource | source |
Returns
Type | Description |
---|---|
bool |