LanguageMachines / libfolia

FoLiA library for C++
https://proycon.github.io/folia
GNU General Public License v3.0
15 stars 7 forks source link

folialint should detect missing annotation declarations #36

Closed kosloot closed 4 years ago

kosloot commented 5 years ago

consider this document:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="folia.xsl"?>
<FoLiA xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://ilk.uvt.nl/folia" xml:id="test" generator="ko" version="2.2.0">
  <metadata type="native">
    <annotations>
      <text-annotation set="tekst" />
    </annotations>
  </metadata>
  <text xml:id="test.text">
    <s xml:id="s1">
      <t>Een zin.</t>
    </s>
  </text>
</FoLiA>

When running foliavalidator on this file we get: ParseError: FoLiA exception in handling of <s> @ line 10 (in parent <text> @ parent line 9) : [DeclarationError] Encountered an instance without proper declaration: Sentence <s>!

With de `-a' option, the document is accepted and an (empty) annotation is added:

<sentence-annotation/>

folialint happily accepts this an just ignores the problem. We would need folialint to warn, AND probably add something like the -a option too.

NOTE: when leaving out the text-annotation declaration too, libfolia DOES an autodeclare of that.

kosloot commented 4 years ago

this was already implemented on august 26