Share via


PhoneticTokenFilter Class

public final class PhoneticTokenFilter
extends TokenFilter

Create tokens for phonetic matches. This token filter is implemented using Apache Lucene.

Constructor Summary

Constructor Description
PhoneticTokenFilter(String name)

Creates an instance of PhoneticTokenFilter class.

Method Summary

Modifier and Type Method and Description
Boolean areOriginalTokensReplaced()

Get the originalTokensReplaced property: A value indicating whether encoded tokens should replace original tokens.

static PhoneticTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of PhoneticTokenFilter from the JsonReader.

PhoneticEncoder getEncoder()

Get the encoder property: The phonetic encoder to use.

String getOdataType()

Get the odataType property: A URI fragment specifying the type of token filter.

PhoneticTokenFilter setEncoder(PhoneticEncoder encoder)

Set the encoder property: The phonetic encoder to use.

PhoneticTokenFilter setOriginalTokensReplaced(Boolean originalTokensReplaced)

Set the originalTokensReplaced property: A value indicating whether encoded tokens should replace original tokens.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from TokenFilter

Methods inherited from java.lang.Object

Constructor Details

PhoneticTokenFilter

public PhoneticTokenFilter(String name)

Creates an instance of PhoneticTokenFilter class.

Parameters:

name - the name value to set.

Method Details

areOriginalTokensReplaced

public Boolean areOriginalTokensReplaced()

Get the originalTokensReplaced property: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true.

Returns:

the originalTokensReplaced value.

fromJson

public static PhoneticTokenFilter fromJson(JsonReader jsonReader)

Reads an instance of PhoneticTokenFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of PhoneticTokenFilter 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.

getEncoder

public PhoneticEncoder getEncoder()

Get the encoder property: The phonetic encoder to use. Default is "metaphone".

Returns:

the encoder value.

getOdataType

public String getOdataType()

Get the odataType property: A URI fragment specifying the type of token filter.

Overrides:

PhoneticTokenFilter.getOdataType()

Returns:

the odataType value.

setEncoder

public PhoneticTokenFilter setEncoder(PhoneticEncoder encoder)

Set the encoder property: The phonetic encoder to use. Default is "metaphone".

Parameters:

encoder - the encoder value to set.

Returns:

the PhoneticTokenFilter object itself.

setOriginalTokensReplaced

public PhoneticTokenFilter setOriginalTokensReplaced(Boolean originalTokensReplaced)

Set the originalTokensReplaced property: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true.

Parameters:

originalTokensReplaced - the originalTokensReplaced value to set.

Returns:

the PhoneticTokenFilter object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

PhoneticTokenFilter.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to