Class ShingleAnalyzerWrapper
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Shingle
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class ShingleAnalyzerWrapper : AnalyzerWrapper, IDisposable
Constructors
ShingleAnalyzerWrapper(Analyzer)
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | defaultAnalyzer |
ShingleAnalyzerWrapper(Analyzer, int)
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | defaultAnalyzer | |
int | maxShingleSize |
ShingleAnalyzerWrapper(Analyzer, int, int)
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int minShingleSize, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | defaultAnalyzer | |
int | minShingleSize | |
int | maxShingleSize |
ShingleAnalyzerWrapper(Analyzer, int, int, string, bool, bool, string)
Creates a new ShingleAnalyzerWrapper
Declaration
public ShingleAnalyzerWrapper(Analyzer @delegate, int minShingleSize, int maxShingleSize, string tokenSeparator, bool outputUnigrams, bool outputUnigramsIfNoShingles, string fillerToken)
Parameters
Type | Name | Description |
---|---|---|
Analyzer | delegate | Lucene.Net.Analysis.Analyzer whose Lucene.Net.Analysis.TokenStream is to be filtered |
int | minShingleSize | Min shingle (token ngram) size |
int | maxShingleSize | Max shingle size |
string | tokenSeparator | Used to separate input stream tokens in output shingles |
bool | outputUnigrams | Whether or not the filter shall pass the original tokens to the output stream |
bool | outputUnigramsIfNoShingles | Overrides the behavior of outputUnigrams==false for those times when no shingles are available (because there are fewer than minShingleSize tokens in the input stream)? Note that if outputUnigrams==true, then unigrams are always output, regardless of whether any shingles are available. |
string | fillerToken | filler token to use when positionIncrement is more than 1 |
ShingleAnalyzerWrapper(LuceneVersion)
Wraps StandardAnalyzer.
Declaration
public ShingleAnalyzerWrapper(LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion |
ShingleAnalyzerWrapper(LuceneVersion, int, int)
Wraps StandardAnalyzer.
Declaration
public ShingleAnalyzerWrapper(LuceneVersion matchVersion, int minShingleSize, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
LuceneVersion | matchVersion | |
int | minShingleSize | |
int | maxShingleSize |
Properties
FillerToken
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public string FillerToken { get; }
Property Value
Type | Description |
---|---|
string |
MaxShingleSize
The max shingle (token ngram) size
Declaration
public int MaxShingleSize { get; }
Property Value
Type | Description |
---|---|
int | The max shingle (token ngram) size |
MinShingleSize
The min shingle (token ngram) size
Declaration
public int MinShingleSize { get; }
Property Value
Type | Description |
---|---|
int | The min shingle (token ngram) size |
OutputUnigrams
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public bool OutputUnigrams { get; }
Property Value
Type | Description |
---|---|
bool |
OutputUnigramsIfNoShingles
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public bool OutputUnigramsIfNoShingles { get; }
Property Value
Type | Description |
---|---|
bool |
TokenSeparator
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Declaration
public string TokenSeparator { get; }
Property Value
Type | Description |
---|---|
string |
Methods
GetWrappedAnalyzer(string)
Retrieves the wrapped Lucene.Net.Analysis.Analyzer appropriate for analyzing the field with the given name
Declaration
protected override sealed Analyzer GetWrappedAnalyzer(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
string | fieldName | Name of the field which is to be analyzed |
Returns
Type | Description |
---|---|
Analyzer | Lucene.Net.Analysis.Analyzer for the field with the given name. Assumed to be non-null |
Overrides
WrapComponents(string, TokenStreamComponents)
Wraps / alters the given Lucene.Net.Analysis.TokenStreamComponents, taken from the wrapped Lucene.Net.Analysis.Analyzer, to form new components. It is through this method that new Lucene.Net.Analysis.TokenFilters can be added by Lucene.Net.Analysis.AnalyzerWrappers. By default, the given components are returned.
Declaration
protected override TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)
Parameters
Type | Name | Description |
---|---|---|
string | fieldName | Name of the field which is to be analyzed |
TokenStreamComponents | components | Lucene.Net.Analysis.TokenStreamComponents taken from the wrapped Lucene.Net.Analysis.Analyzer |
Returns
Type | Description |
---|---|
TokenStreamComponents | Wrapped / altered Lucene.Net.Analysis.TokenStreamComponents. |