NGramTokenizer Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. LexicalTokenizer - com.
azure. search. documents. indexes. models. NGramTokenizer
- com.
- com.
public final class NGramTokenizer
extends LexicalTokenizer
Tokenizes the input into n-grams of the given size(s). This tokenizer is implemented using Apache Lucene.
Constructor Summary
| Constructor | Description |
|---|---|
| NGramTokenizer(String name) |
Creates an instance of NGram |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
NGram |
fromJson(JsonReader jsonReader)
Reads an instance of NGram |
| Integer |
getMaxGram()
Get the max |
| Integer |
getMinGram()
Get the min |
| String |
getOdataType()
Get the odata |
|
List<Token |
getTokenChars()
Get the token |
|
NGram |
setMaxGram(Integer maxGram)
Set the max |
|
NGram |
setMinGram(Integer minGram)
Set the min |
|
NGram |
setTokenChars(List<TokenCharacterKind> tokenChars)
Set the token |
|
NGram |
setTokenChars(TokenCharacterKind[] tokenChars)
Set the token |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from LexicalTokenizer
Methods inherited from java.lang.Object
Constructor Details
NGramTokenizer
public NGramTokenizer(String name)
Creates an instance of NGramTokenizer class.
Parameters:
Method Details
fromJson
public static NGramTokenizer fromJson(JsonReader jsonReader)
Reads an instance of NGramTokenizer from the JsonReader.
Parameters:
Returns:
Throws:
getMaxGram
public Integer getMaxGram()
Get the maxGram property: The maximum n-gram length. Default is 2. Maximum is 300.
Returns:
getMinGram
public Integer getMinGram()
Get the minGram property: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram.
Returns:
getOdataType
public String getOdataType()
Get the odataType property: A URI fragment specifying the type of tokenizer.
Overrides:
NGramTokenizer.getOdataType()Returns:
getTokenChars
public List<TokenCharacterKind> getTokenChars()
Get the tokenChars property: Character classes to keep in the tokens.
Returns:
setMaxGram
public NGramTokenizer setMaxGram(Integer maxGram)
Set the maxGram property: The maximum n-gram length. Default is 2. Maximum is 300.
Parameters:
Returns:
setMinGram
public NGramTokenizer setMinGram(Integer minGram)
Set the minGram property: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the value of maxGram.
Parameters:
Returns:
setTokenChars
public NGramTokenizer setTokenChars(List<TokenCharacterKind> tokenChars)
Set the tokenChars property: Character classes to keep in the tokens.
Parameters:
Returns:
setTokenChars
public NGramTokenizer setTokenChars(TokenCharacterKind[] tokenChars)
Set the tokenChars property: Character classes to keep in the tokens.
Parameters:
Returns:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
NGramTokenizer.toJson(JsonWriter jsonWriter)Parameters:
Throws: