Interface TextSegmentTransformer

  • All Implemented Interfaces:

    
    public interface TextSegmentTransformer
    
                        

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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract TextSegment transform(TextSegment segment) Transforms a provided segment.
      List<TextSegment> transformAll(List<TextSegment> segments) Transforms all the provided segments.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • transform

         abstract 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

         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.