Class ShingleAnalyzerWrapper
A ShingleAnalyzerWrapper wraps a ShingleFilter around another Lucene.Net.Analysis.Analyzer.
A shingle is another name for a token based n-gram.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.Shingle
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class ShingleAnalyzerWrapper : AnalyzerWrapper, IDisposable
Constructors
| Improve this Doc View SourceShingleAnalyzerWrapper(Analyzer)
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Analysis.Analyzer | defaultAnalyzer |
ShingleAnalyzerWrapper(Analyzer, Int32)
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Analysis.Analyzer | defaultAnalyzer | |
System.Int32 | maxShingleSize |
ShingleAnalyzerWrapper(Analyzer, Int32, Int32)
Declaration
public ShingleAnalyzerWrapper(Analyzer defaultAnalyzer, int minShingleSize, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Analysis.Analyzer | defaultAnalyzer | |
System.Int32 | minShingleSize | |
System.Int32 | maxShingleSize |
ShingleAnalyzerWrapper(Analyzer, Int32, Int32, String, Boolean, Boolean, 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 |
---|---|---|
Lucene.Net.Analysis.Analyzer | delegate | Lucene.Net.Analysis.Analyzer whose Lucene.Net.Analysis.TokenStream is to be filtered |
System.Int32 | minShingleSize | Min shingle (token ngram) size |
System.Int32 | maxShingleSize | Max shingle size |
System.String | tokenSeparator | Used to separate input stream tokens in output shingles |
System.Boolean | outputUnigrams | Whether or not the filter shall pass the original tokens to the output stream |
System.Boolean | 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. |
System.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 |
---|---|---|
Lucene.Net.Util.LuceneVersion | matchVersion |
ShingleAnalyzerWrapper(LuceneVersion, Int32, Int32)
Wraps StandardAnalyzer.
Declaration
public ShingleAnalyzerWrapper(LuceneVersion matchVersion, int minShingleSize, int maxShingleSize)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Util.LuceneVersion | matchVersion | |
System.Int32 | minShingleSize | |
System.Int32 | maxShingleSize |
Properties
| Improve this Doc View SourceFillerToken
Declaration
public string FillerToken { get; }
Property Value
Type | Description |
---|---|
System.String |
MaxShingleSize
The max shingle (token ngram) size
Declaration
public int MaxShingleSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The max shingle (token ngram) size |
MinShingleSize
The min shingle (token ngram) size
Declaration
public int MinShingleSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The min shingle (token ngram) size |
OutputUnigrams
Declaration
public bool OutputUnigrams { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OutputUnigramsIfNoShingles
Declaration
public bool OutputUnigramsIfNoShingles { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TokenSeparator
Declaration
public string TokenSeparator { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceGetWrappedAnalyzer(String)
Declaration
protected override sealed Analyzer GetWrappedAnalyzer(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName |
Returns
Type | Description |
---|---|
Lucene.Net.Analysis.Analyzer |
Overrides
| Improve this Doc View SourceWrapComponents(String, TokenStreamComponents)
Declaration
protected override TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | |
Lucene.Net.Analysis.TokenStreamComponents | components |
Returns
Type | Description |
---|---|
Lucene.Net.Analysis.TokenStreamComponents |