Record Class DocumentSegment
java.lang.Object
java.lang.Record
com.tnsai.intelligence.rag.segment.DocumentSegment
- Record Components:
index- zero-based order in the sourcesectionId- numbered identity such as3.1, empty for preamblesectionTitle- heading text without the leading markersbody- section text including attached figure captionscrossRefs- resolved or raw references found in the bodycumulativeSummary- first-sentence digest of all preceding sectionsfigures- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.Returns the value of thecrossRefsrecord component.Returns the value of thecumulativeSummaryrecord component.final booleanIndicates whether some other object is "equal to" this one.figures()Returns the value of thefiguresrecord component.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.Returns the value of thesectionIdrecord component.Returns the value of thesectionTitlerecord component.final StringtoString()Returns a string representation of this record class.
-
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 aDocumentSegmentrecord class.- Parameters:
index- the value for theindexrecord componentsectionId- the value for thesectionIdrecord componentsectionTitle- the value for thesectionTitlerecord componentbody- the value for thebodyrecord componentcrossRefs- the value for thecrossRefsrecord componentcumulativeSummary- the value for thecumulativeSummaryrecord componentfigures- the value for thefiguresrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
sectionId
Returns the value of thesectionIdrecord component.- Returns:
- the value of the
sectionIdrecord component
-
sectionTitle
Returns the value of thesectionTitlerecord component.- Returns:
- the value of the
sectionTitlerecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
crossRefs
Returns the value of thecrossRefsrecord component.- Returns:
- the value of the
crossRefsrecord component
-
cumulativeSummary
Returns the value of thecumulativeSummaryrecord component.- Returns:
- the value of the
cumulativeSummaryrecord component
-
figures
Returns the value of thefiguresrecord component.- Returns:
- the value of the
figuresrecord component
-