segment_clauses
Segment contracts into numbered clauses and headings with stable anchors across English and Arabic numbering styles. Produces citable references for finding exact clauses.
Instructions
Split the document into numbered clauses and headings, handling English and Arabic numbering conventions. English decimal (1, 1.1, 1.1.1), lettered and roman sub items, and the Arabic conventions المادة (٣), البند الأول, standalone ordinals أولاً and ثانياً, and Arabic decimal ٣-٢ written with a hyphen. Each clause gets a stable anchor such as "C14", its label exactly as the document writes it, an ASCII normalised label for comparison, its nesting depth, its parent clause, and the paragraph anchors it covers. Cite these anchors so the reader can find the exact clause.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the document. Accepts .pdf, .docx or a plain text file (.txt, .md). Absolute paths are safest. The format is detected from the file content, not the extension. | |
| maxClauses | No | Return at most this many clauses. Omit for all of them. | |
| includeText | No | Include each clause full text. Default true. |