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.
      segment - The segment to be transformed.
      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.
      segments - A list of segments to be transformed.
      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.