org.apache.lucene.search.highlight

## Class TokenGroup

- java.lang.Object
- - org.apache.lucene.search.highlight.TokenGroup

-     public class TokenGroup
      extends java.lang.Object

  One, or several overlapping tokens, along with the score(s) and the scope of the original text

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenGroup(org.apache.lucene.analysis.TokenStream tokenStream)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getEndOffset()`
    `int` | `getNumTokens()`
    `float` | `getScore(int index)`
    `int` | `getStartOffset()`
    `org.apache.lucene.analysis.Token` | `getToken(int index)`
    `float` | `getTotalScore()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### TokenGroup

          public TokenGroup(org.apache.lucene.analysis.TokenStream tokenStream)

  - ### Method Detail

    - #### getToken

          public org.apache.lucene.analysis.Token getToken(int index)

    - #### getScore

          public float getScore(int index)

      Parameters:
        `index` - a value between 0 and numTokens -1
      Returns:
        the "n"th score

    - #### getEndOffset

          public int getEndOffset()

      Returns:
        the end position in the original text

    - #### getNumTokens

          public int getNumTokens()

      Returns:
        the number of tokens in this group

    - #### getStartOffset

          public int getStartOffset()

      Returns:
        the start position in the original text

    - #### getTotalScore

          public float getTotalScore()

      Returns:
        all tokens' scores summed up

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.