Description
Return span length and endpoint offsets for named anchors.
Digital editions connect textual witnesses, anchors, page images and source-specific labels. Literal identifier agreement and numerical offsets preserve a supplied convention without proving textual authority, complete coverage or correct editorial interpretation.
Return span length and endpoint offsets for named anchors.
When to use this tool
Use TEI Anchor Range Length when checking supplied edition identifiers, ordering or coordinate conventions.
How to use the tool and how it works
- Enter anchorIds, offsets, startAnchor, endAnchor, includeEndUnit. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read length, startOffset, endOffset. Use the output convention below.
Return span length and endpoint offsets for named anchors. Require unique anchor IDs, aligned nonnegative nondecreasing offsets and end-anchor index >= start-anchor index; length = endOffset-startOffset, adding one when includeEndUnit.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| anchorIds | Anchor Ids | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| offsets | Offsets | Required. Array of safe integer; maximum items 256. |
| startAnchor | Start Anchor | Required. Text; maximum UTF-16 length 8192. |
| endAnchor | End Anchor | Required. Text; maximum UTF-16 length 8192. |
| includeEndUnit | Include End Unit | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| length | Offset difference, plus one when includeEndUnit; one must represent a discrete unit. | Required. Safe integer. |
| startOffset | Start Offset | Required. Safe integer. |
| endOffset | End Offset | Required. Safe integer. |
{
"input": {
"anchorIds": [
"a",
"b",
"c"
],
"offsets": [
0,
10,
20
],
"startAnchor": "a",
"endAnchor": "c",
"includeEndUnit": false
},
"output": {
"length": 20,
"startOffset": 0,
"endOffset": 20
}
} Limitations and assumptions
- The offset unit is supplied; inclusive addition assumes one discrete unit rather than inferring character encoding.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Inspect the original edition and its encoding model before treating local record agreement as meaningful textual or historical evidence.
References
Similar or alternative tools
- Citation Anchor Character Offset
Return a quote's signed offset relative to an anchor.
- OCR Word Origin Affinity
Return an OCR word-box anchor relative to an origin.