Class AnalyzedTokenInfo

java.lang.Object
com.azure.search.documents.indexes.models.AnalyzedTokenInfo
All Implemented Interfaces:
com.azure.json.JsonSerializable<AnalyzedTokenInfo>

public final class AnalyzedTokenInfo extends Object implements com.azure.json.JsonSerializable<AnalyzedTokenInfo>
Information about a token returned by an analyzer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnalyzedTokenInfo(String token, int startOffset, int endOffset, int position)
    Creates an instance of AnalyzedTokenInfo class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of AnalyzedTokenInfo from the JsonReader.
    int
    Get the endOffset property: The index of the last character of the token in the input text.
    int
    Get the position property: The position of the token in the input text relative to other tokens.
    int
    Get the startOffset property: The index of the first character of the token in the input text.
    Get the token property: The token returned by the analyzer.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • AnalyzedTokenInfo

      public AnalyzedTokenInfo(String token, int startOffset, int endOffset, int position)
      Creates an instance of AnalyzedTokenInfo class.
      Parameters:
      token - the token value to set.
      startOffset - the startOffset value to set.
      endOffset - the endOffset value to set.
      position - the position value to set.
  • Method Details

    • getToken

      public String getToken()
      Get the token property: The token returned by the analyzer.
      Returns:
      the token value.
    • getStartOffset

      public int getStartOffset()
      Get the startOffset property: The index of the first character of the token in the input text.
      Returns:
      the startOffset value.
    • getEndOffset

      public int getEndOffset()
      Get the endOffset property: The index of the last character of the token in the input text.
      Returns:
      the endOffset value.
    • getPosition

      public int getPosition()
      Get the position property: The position of the token in the input text relative to other tokens. The first token in the input text has position 0, the next has position 1, and so on. Depending on the analyzer used, some tokens might have the same position, for example if they are synonyms of each other.
      Returns:
      the position value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AnalyzedTokenInfo>
      Throws:
      IOException
    • fromJson

      public static AnalyzedTokenInfo fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of AnalyzedTokenInfo from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of AnalyzedTokenInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the AnalyzedTokenInfo.