An extensive Python library for dealing with FoLiA (Format for Linguistic Annotation) documents, a rich XML-based format for linguistic annotation finding application in Natural Language Processing (NLP). This library was formerly part of PyNLPl.
When a text content has an offset without a explicit reference, the offset is per definition relative to the text content of the nearest structure parent. In general this is OK, but there are structure elements that MAY NOT carry text.
Notably <table> and <row>, maybe more.
I suggest to extend the search for a suitable parent to the first structure parent that is allowed to carry text.
A simple addition that I already implemented in libfolia.
Sample FoLiA to demonstrate the problem:
The most recent folialint from libfolia approves this.
But the current foliavalidator states:
EXT VALIDATION ERROR: Text for Cell, ID tabel.row.1.cell.1, textclass current, has incorrect offset 0 or invalid reference: Reference (ID tabel.row.1) has no such text (class=current)
(also checked against older rules prior to FoLiA v2.4.1)
VALIDATION ERROR on full parse by library (stage 2/3), in cell-offset-bug.xml
UnresolvableTextContent: Reference (ID tabel.row.1) has no such text (class=current)
When a text content has an offset without a explicit reference, the offset is per definition relative to the text content of the nearest structure parent. In general this is OK, but there are structure elements that MAY NOT carry text. Notably
<table>
and<row>
, maybe more. I suggest to extend the search for a suitable parent to the first structure parent that is allowed to carry text.A simple addition that I already implemented in libfolia. Sample FoLiA to demonstrate the problem:
The most recent folialint from libfolia approves this.
But the current foliavalidator states: