Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Protected Member Functions | List of all members
Lucene.Net.Analysis.Analyzer Class Referenceabstract

An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index terms from text. Typical implementations first build a Tokenizer, which breaks the stream of characters from the Reader into raw Tokens. One or more TokenFilters may then be applied to the output of the Tokenizer. More...

Inherits IDisposable.

Inherited by Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net.Analysis.BR.BrazilianAnalyzer, Lucene.Net.Analysis.CJK.CJKAnalyzer, Lucene.Net.Analysis.Cn.ChineseAnalyzer, Lucene.Net.Analysis.Cz.CzechAnalyzer, Lucene.Net.Analysis.De.GermanAnalyzer, Lucene.Net.Analysis.El.GreekAnalyzer, Lucene.Net.Analysis.Ext.SingleCharTokenAnalyzer, Lucene.Net.Analysis.Ext.UnaccentedWordAnalyzer, Lucene.Net.Analysis.Fa.PersianAnalyzer, Lucene.Net.Analysis.Fr.FrenchAnalyzer, Lucene.Net.Analysis.KeywordAnalyzer, Lucene.Net.Analysis.Miscellaneous.PatternAnalyzer, Lucene.Net.Analysis.Nl.DutchAnalyzer, Lucene.Net.Analysis.PerFieldAnalyzerWrapper, Lucene.Net.Analysis.Query.QueryAutoStopWordAnalyzer, Lucene.Net.Analysis.Ru.RussianAnalyzer, Lucene.Net.Analysis.Shingle.ShingleAnalyzerWrapper, Lucene.Net.Analysis.SimpleAnalyzer, Lucene.Net.Analysis.Snowball.SnowballAnalyzer, Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net.Analysis.StopAnalyzer, Lucene.Net.Analysis.Th.ThaiAnalyzer, and Lucene.Net.Analysis.WhitespaceAnalyzer.

Public Member Functions

abstract TokenStream TokenStream (String fieldName, System.IO.TextReader reader)
 Creates a TokenStream which tokenizes all the text in the provided Reader. Must be able to handle null field name for backward compatibility.
 
virtual TokenStream ReusableTokenStream (String fieldName, System.IO.TextReader reader)
 Creates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method. Callers that do not need to use more than one TokenStream at the same time from this analyzer should use this method for better performance.
 
virtual int GetPositionIncrementGap (String fieldName)
 Invoked before indexing a Fieldable instance if terms have already been added to that field. This allows custom analyzers to place an automatic position increment gap between Fieldable instances using the same field name. The default value position increment gap is 0. With a 0 position increment gap and the typical default token position increment of 1, all terms in a field, including across Fieldable instances, are in successive positions, allowing exact PhraseQuery matches, for instance, across Fieldable instance boundaries.
 
virtual int GetOffsetGap (IFieldable field)
 Just like GetPositionIncrementGap, except for Token offsets instead. By default this returns 1 for tokenized fields and, as if the fields were joined with an extra space character, and 0 for un-tokenized fields. This method is only called if the field produced at least one token for indexing.
 
void Close ()
 Frees persistent resources used by this Analyzer
 
virtual void Dispose ()
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

An Analyzer builds TokenStreams, which analyze text. It thus represents a policy for extracting index terms from text.

Typical implementations first build a Tokenizer, which breaks the stream of characters from the Reader into raw Tokens. One or more TokenFilters may then be applied to the output of the Tokenizer.

Definition at line 32 of file Analyzer.cs.

Member Function Documentation

void Lucene.Net.Analysis.Analyzer.Close ( )

Frees persistent resources used by this Analyzer

Definition at line 146 of file Analyzer.cs.

virtual void Lucene.Net.Analysis.Analyzer.Dispose ( )
virtual

Definition at line 151 of file Analyzer.cs.

virtual void Lucene.Net.Analysis.Analyzer.Dispose ( bool  disposing)
protectedvirtual

Definition at line 156 of file Analyzer.cs.

virtual int Lucene.Net.Analysis.Analyzer.GetOffsetGap ( IFieldable  field)
virtual

Just like GetPositionIncrementGap, except for Token offsets instead. By default this returns 1 for tokenized fields and, as if the fields were joined with an extra space character, and 0 for un-tokenized fields. This method is only called if the field produced at least one token for indexing.

Parameters
fieldthe field just indexed
Returns
offset gap, added to the next token emitted from TokenStream(String,System.IO.TextReader)

Reimplemented in Lucene.Net.Analysis.PerFieldAnalyzerWrapper.

Definition at line 140 of file Analyzer.cs.

virtual int Lucene.Net.Analysis.Analyzer.GetPositionIncrementGap ( String  fieldName)
virtual

Invoked before indexing a Fieldable instance if terms have already been added to that field. This allows custom analyzers to place an automatic position increment gap between Fieldable instances using the same field name. The default value position increment gap is 0. With a 0 position increment gap and the typical default token position increment of 1, all terms in a field, including across Fieldable instances, are in successive positions, allowing exact PhraseQuery matches, for instance, across Fieldable instance boundaries.

Parameters
fieldNameFieldable name being indexed.
Returns
position increment gap, added to the next token emitted from TokenStream(String,System.IO.TextReader)

Definition at line 123 of file Analyzer.cs.

virtual TokenStream Lucene.Net.Analysis.Analyzer.ReusableTokenStream ( String  fieldName,
System.IO.TextReader  reader 
)
virtual

Creates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method. Callers that do not need to use more than one TokenStream at the same time from this analyzer should use this method for better performance.

Definition at line 47 of file Analyzer.cs.

abstract TokenStream Lucene.Net.Analysis.Analyzer.TokenStream ( String  fieldName,
System.IO.TextReader  reader 
)
pure virtual

Creates a TokenStream which tokenizes all the text in the provided Reader. Must be able to handle null field name for backward compatibility.


The documentation for this class was generated from the following file: