Class EdgeNGramTokenFilter
Tokenizes the given token into n-grams of given size(s).
This Lucene.Net.Analysis.TokenFilter create n-grams from the beginning edge or ending edge of a input token.
As of Lucene 4.4, this filter does not support BACK (you can use ReverseStringFilter up-front and afterward to get the same behavior), handles supplementary characters correctly and does not update offsets anymore.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Analysis.NGram
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public sealed class EdgeNGramTokenFilter : TokenFilter, IDisposable
Constructors
| Improve this Doc View SourceEdgeNGramTokenFilter(LuceneVersion, TokenStream, EdgeNGramTokenFilter.Side, Int32, Int32)
Creates EdgeNGramTokenFilter that can generate n-grams in the sizes of the given range
Declaration
[Obsolete]
public EdgeNGramTokenFilter(LuceneVersion version, TokenStream input, EdgeNGramTokenFilter.Side side, int minGram, int maxGram)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Util.LuceneVersion | version | the Lucene match version - See Lucene.Net.Util.LuceneVersion |
Lucene.Net.Analysis.TokenStream | input | Lucene.Net.Analysis.TokenStream holding the input to be tokenized |
EdgeNGramTokenFilter.Side | side | the EdgeNGramTokenFilter.Side from which to chop off an n-gram |
System.Int32 | minGram | the smallest n-gram to generate |
System.Int32 | maxGram | the largest n-gram to generate |
EdgeNGramTokenFilter(LuceneVersion, TokenStream, Int32, Int32)
Creates EdgeNGramTokenFilter that can generate n-grams in the sizes of the given range
Declaration
public EdgeNGramTokenFilter(LuceneVersion version, TokenStream input, int minGram, int maxGram)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Util.LuceneVersion | version | the Lucene match version - See Lucene.Net.Util.LuceneVersion |
Lucene.Net.Analysis.TokenStream | input | Lucene.Net.Analysis.TokenStream holding the input to be tokenized |
System.Int32 | minGram | the smallest n-gram to generate |
System.Int32 | maxGram | the largest n-gram to generate |
EdgeNGramTokenFilter(LuceneVersion, TokenStream, String, Int32, Int32)
Creates EdgeNGramTokenFilter that can generate n-grams in the sizes of the given range
Declaration
[Obsolete]
public EdgeNGramTokenFilter(LuceneVersion version, TokenStream input, string sideLabel, int minGram, int maxGram)
Parameters
Type | Name | Description |
---|---|---|
Lucene.Net.Util.LuceneVersion | version | the Lucene match version - See Lucene.Net.Util.LuceneVersion |
Lucene.Net.Analysis.TokenStream | input | Lucene.Net.Analysis.TokenStream holding the input to be tokenized |
System.String | sideLabel | the name of the EdgeNGramTokenFilter.Side from which to chop off an n-gram |
System.Int32 | minGram | the smallest n-gram to generate |
System.Int32 | maxGram | the largest n-gram to generate |
Fields
| Improve this Doc View SourceDEFAULT_MAX_GRAM_SIZE
Declaration
public const int DEFAULT_MAX_GRAM_SIZE = 1
Field Value
Type | Description |
---|---|
System.Int32 |
DEFAULT_MIN_GRAM_SIZE
Declaration
public const int DEFAULT_MIN_GRAM_SIZE = 1
Field Value
Type | Description |
---|---|
System.Int32 |
DEFAULT_SIDE
Declaration
public const EdgeNGramTokenFilter.Side DEFAULT_SIDE = EdgeNGramTokenFilter.Side.FRONT
Field Value
Type | Description |
---|---|
EdgeNGramTokenFilter.Side |
Methods
| Improve this Doc View SourceGetSide(String)
Get the appropriate EdgeNGramTokenFilter.Side from a string
Declaration
public static EdgeNGramTokenFilter.Side GetSide(string sideName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sideName |
Returns
Type | Description |
---|---|
EdgeNGramTokenFilter.Side |
IncrementToken()
Declaration
public sealed override bool IncrementToken()
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Reset()
Declaration
public override void Reset()