Interface TextSegmentTransformer


public interface TextSegmentTransformer
Defines the interface for transforming a TextSegment. Implementations can perform a variety of tasks such as transforming, filtering, enriching, etc.
  • Method Details

    • transform

      TextSegment transform(TextSegment segment)
      Transforms a provided segment.
      Parameters:
      segment - The segment to be transformed.
      Returns:
      The transformed segment, or null if the segment should be filtered out.
    • transformAll

      default List<TextSegment> transformAll(List<TextSegment> segments)
      Transforms all the provided segments.
      Parameters:
      segments - A list of segments to be transformed.
      Returns:
      A list of transformed segments. The length of this list may be shorter or longer than the original list. Returns an empty list if all segments were filtered out.