Class SmartDocumentSegmenter

java.lang.Object
com.tnsai.intelligence.rag.segment.SmartDocumentSegmenter

public final class SmartDocumentSegmenter extends Object
Heading-aware splitter for long-document analysis.

Markdown is read as UTF-8. PDF and DOCX go through the installed ContentExtractorRegistry; missing backends fail loud. Each section keeps figure captions that sit next to it, resolves Section X.Y references against later headings, and carries a cumulative first-sentence digest of the preceding sections.

Since:
0.14.0
  • Constructor Details

    • SmartDocumentSegmenter

      public SmartDocumentSegmenter()
      Uses the discovered extractor registry.
  • Method Details

    • segment

      public List<DocumentSegment> segment(String text)
      Segments already-extracted text (Markdown or plain extracted prose).
      Parameters:
      text - document text
      Returns:
      ordered sections; never empty for non-blank input
    • segment

      public List<DocumentSegment> segment(Path file)
      Reads a file and segments it. .md is UTF-8; PDF/DOCX use the installed extractors.
      Parameters:
      file - source path
      Returns:
      ordered sections