A ShingleFilter constructs shingles (token n-grams) from a token stream. In other words, it creates combinations of tokens as a single token.

For example, the sentence "please divide this sentence into shingles" might be tokenized into shingles "please divide", "divide this", "this sentence", "sentence into", and "into shingles".

This filter handles position increments > 1 by inserting filler tokens (tokens with termtext "_"). It does not handle a position increment of 0.

Namespace: Lucene.Net.Analyzers.Shingle
Assembly: Lucene.Net.Contrib.Analyzers (in Lucene.Net.Contrib.Analyzers.dll) Version: 2.9.2.1 (2.9.2.1)

Syntax

C#
public class ShingleFilter : TokenFilter
Visual Basic
Public Class ShingleFilter _
	Inherits TokenFilter
Visual C++
public ref class ShingleFilter : public TokenFilter

Inheritance Hierarchy

System..::..Object
  Lucene.Net.Util..::..AttributeSource
    Lucene.Net.Analysis..::..TokenStream
      Lucene.Net.Analysis..::..TokenFilter
        Lucene.Net.Analyzers.Shingle..::..ShingleFilter

See Also