@recogito/text-annotator-tei
v4.2.5
Published
Recogito Text Annotator TEI extension
Downloads
14,503
Readme
Recogito Text Annotator: TEI/XML Extension
An extension to the Text Annotator to work with TEI/XML using CETEIcean.
Installation
npm install CETEIcean @recogito/text-annotator @recogito/text-annotator-teiQuick Start
import CETEI from 'CETEIcean';
import { createTextAnnotator } from '@recogito/text-annotator';
import { TEIPlugin } from '@recogito/text-annotator-tei';
window.onload = async function () {
const CETEIcean = new CETEI();
CETEIcean.getHTML5('paradise-lost.xml', data => {
document.getElementById('content').appendChild(data);
const anno = TEIPlugin(createTextAnnotator(document.getElementById('content')));
});
}Annotation Format
The TEI plugin adds XPath expressions for the annotation start and end to the target.selector.
{
"id": "33e0bcb2-801e-4b61-82c5-fa8daaa92dae",
"bodies": [],
"target": {
"selector": [{
"start": 1878,
"startSelector": {
"type": "XPathSelector",
"value": "//text[@xml:id='text-1']/body[1]/div[1]/div[1]/lg[1]/l[1]::0"
},
"end": 1904,
"endSelector": {
"type": "XPathSelector",
"value": "//text[@xml:id='text-1']/body[1]/div[1]/div[1]/lg[1]/l[1]::26"
},
"quote": "Of Mans First Disobedience"
}],
"creator": {
"id": "miBoI4WgDjdPYGTfJ5P0"
},
"created": "2025-09-30T08:38:16.566Z",
"updated": "2025-09-30T08:38:17.092Z"
}
}