NGramTokenFilter Class

public final class NGramTokenFilter
extends TokenFilter

Generates n-grams of the given size(s). This token filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
NGramTokenFilter(String name)

Creates an instance of NGramTokenFilter class.

Method Summary

Modifier and Type Method and Description
static NGramTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of NGramTokenFilter from the JsonReader.

Integer getMaxGram()

Get the maxGram property: The maximum n-gram length.

Integer getMinGram()

Get the minGram property: The minimum n-gram length.

String getOdataType()

Get the odataType property: The discriminator for derived types.

NGramTokenFilter setMaxGram(Integer maxGram)

Set the maxGram property: The maximum n-gram length.

NGramTokenFilter setMinGram(Integer minGram)

Set the minGram property: The minimum n-gram length.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from TokenFilter

Methods inherited from java.lang.Object

Constructor Details

NGramTokenFilter

public NGramTokenFilter(String name)

Creates an instance of NGramTokenFilter class.

Parameters:

name - the name value to set.

Method Details

fromJson

public static NGramTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of NGramTokenFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of NGramTokenFilter if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getMaxGram

public Integer getMaxGram()

Get the maxGram property: The maximum n-gram length. Default is 2.

Returns:

the maxGram value.

getMinGram

public Integer getMinGram()

Get the minGram property: The minimum n-gram length. Default is 1. Must be less than the value of maxGram.

Returns:

the minGram value.

getOdataType

public String getOdataType()

Get the odataType property: The discriminator for derived types.

Overrides:

NGramTokenFilter.getOdataType()

Returns:

the odataType value.

setMaxGram

public NGramTokenFilter setMaxGram(Integer maxGram)

Set the maxGram property: The maximum n-gram length. Default is 2.

Parameters:

maxGram - the maxGram value to set.

Returns:

the NGramTokenFilter object itself.

setMinGram

public NGramTokenFilter setMinGram(Integer minGram)

Set the minGram property: The minimum n-gram length. Default is 1. Must be less than the value of maxGram.

Parameters:

minGram - the minGram value to set.

Returns:

the NGramTokenFilter object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

NGramTokenFilter.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to