extract_segments
Extracts translatable sentences from S1000D data modules, preserving stable IDs, XPath and inline placeholders, and returns a skeleton hash for applying translations later.
Instructions
Take the sentences that a person reads out of a data module so they can be translated: titles, paragraphs, step texts, warnings / cautions / notes, table cells and figure captions. Each segment has a stable id, its XPath, a context hint and the text, with inline elements (emphasis, references …) replaced by {1}, {2} placeholders that must stay in the translation. Attribute values, DMCs, ICNs, applicability expressions and ids are never offered. Also returns the skeletonHash to pass to apply_segments. The server does not translate and does not score translations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | An existing document as an XML string (alternative to path; max 5 MB). Not for XML you wrote yourself: build new data modules with build_data_module. | |
| path | No | File path of the document. | |
| include | No | Which kinds of sentences to return (default: all). | |
| maxSegments | No | Cap on the number of segments returned. |