Interface OffsetMappingNameFinder

All Superinterfaces:
TokenNameFinder

public interface OffsetMappingNameFinder extends TokenNameFinder
A TokenNameFinder that can additionally report detected spans in the character coordinates of the original input, mapping back through any text normalization applied before detection.

TokenNameFinder.find(String[]) may report spans in the coordinates of the normalized text, which differ from the caller's input when normalization changes the length. findInOriginal(String[]) reports the same spans in original-input coordinates.

Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Finds names and returns their spans in the character coordinates of the original input, regardless of any normalization applied before detection.

    Methods inherited from interface TokenNameFinder

    clearAdaptiveData, find
  • Method Details

    • findInOriginal

      Span[] findInOriginal(String[] tokens)
      Finds names and returns their spans in the character coordinates of the original input, regardless of any normalization applied before detection.
      Parameters:
      tokens - The tokens to search.
      Returns:
      The detected spans, in original-input character coordinates.
      Throws:
      IllegalArgumentException - Thrown if tokens is null or contains a null token.