Record Class DocumentSegment

java.lang.Object
java.lang.Record
com.tnsai.intelligence.rag.segment.DocumentSegment
Record Components:
index - zero-based order in the source
sectionId - numbered identity such as 3.1, empty for preamble
sectionTitle - heading text without the leading markers
body - section text including attached figure captions
crossRefs - resolved or raw references found in the body
cumulativeSummary - first-sentence digest of all preceding sections
figures - caption lines kept with this section

public record DocumentSegment(int index, String sectionId, String sectionTitle, String body, List<String> crossRefs, String cumulativeSummary, List<String> figures) extends Record
One heading-bounded section of a long document.
Since:
0.14.0
  • Constructor Details

    • DocumentSegment

      public DocumentSegment(int index, String sectionId, String sectionTitle, String body, List<String> crossRefs, String cumulativeSummary, List<String> figures)
      Creates an instance of a DocumentSegment record class.
      Parameters:
      index - the value for the index record component
      sectionId - the value for the sectionId record component
      sectionTitle - the value for the sectionTitle record component
      body - the value for the body record component
      crossRefs - the value for the crossRefs record component
      cumulativeSummary - the value for the cumulativeSummary record component
      figures - the value for the figures record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • sectionId

      public String sectionId()
      Returns the value of the sectionId record component.
      Returns:
      the value of the sectionId record component
    • sectionTitle

      public String sectionTitle()
      Returns the value of the sectionTitle record component.
      Returns:
      the value of the sectionTitle record component
    • body

      public String body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • crossRefs

      public List<String> crossRefs()
      Returns the value of the crossRefs record component.
      Returns:
      the value of the crossRefs record component
    • cumulativeSummary

      public String cumulativeSummary()
      Returns the value of the cumulativeSummary record component.
      Returns:
      the value of the cumulativeSummary record component
    • figures

      public List<String> figures()
      Returns the value of the figures record component.
      Returns:
      the value of the figures record component