SentenceAttribute (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.analysis.tokenattributes, interface: SentenceAttribute

Package org.apache.lucene.analysis.tokenattributes

# Interface SentenceAttribute

All Superinterfaces:
  `Attribute`

All Known Implementing Classes:
  `SentenceAttributeImpl`

public interface SentenceAttribute extends Attribute
This attribute tracks what sentence a given token belongs to as well as potentially other sentence specific attributes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getSentenceIndex()`
  Get the sentence index for the current token
  `void`
  `setSentenceIndex(int sentenceIndex)`
  Set the sentence of the current token

- ## Method Details

  - ### getSentenceIndex

    int getSentenceIndex()
    Get the sentence index for the current token
    Returns:
      The index of the sentence
    See Also:
      - `getSentenceIndex()`

  - ### setSentenceIndex

    void setSentenceIndex(int sentenceIndex)
    Set the sentence of the current token
    See Also:
      - `setSentenceIndex(int sentenceIndex)`