proycon / foliatools

A number of command-line tools for working with FoLiA (Format for Linguistic Annotation). Includes validators, converters, visualisers, and more.
GNU General Public License v3.0
10 stars 4 forks source link

validation error on document with 2 correction processors #38

Closed kosloot closed 3 years ago

kosloot commented 3 years ago

given the attached new_bug.xml.txt document

foliavalidator comes up with this error:

foliavalidator new_bug.xml VALIDATION ERROR on full parse by library (stage 2/3), in new_bug.xml ParseError: FoLiA exception in handling of @ line 34 (in parent @ parent line 33) : [DeclarationError] Encountered an instance without proper declaration: New !

This can be resolved by removing 1 of the correction-annotation declarations. But of course this is an excerpt form a document where more corrector were in charge.

A new-annotation doesn't exist. And also adding a set or a processor to <new> is not allowed (and undesirable)

So how to fix this document? Or does foliavalidator need fixing?

proycon commented 3 years ago

Ok, somethings definitely wrong in the python library then, the document looks fine. Must be something I was working on yesterday that broke this probably.

kosloot commented 3 years ago

Must be something I was working on yesterday that broke this probably.

@proycon I didn't update foliatools, so that can't be the case, I assume

After an update, the error still remains.

> foliavalidator -V FoLiA-tools v2.5.1, using FoLiA v2.5.0 with library FoLiApy v2.5.3

kosloot commented 3 years ago

I looked up the code in libfolia, and it has an explicit exception for AbstractCorrectionChild in check_set_declaration(). those are accepted as is, without any checking. (too lax maybe?)

proycon commented 3 years ago

I implemented that solution as well now, no need to check for declarations on AbstractChildCorrection indeed. But I can't really understand why it failed on your file while it succeeds on all the tests and examples in the test suite (which use too). Your file was fine and didn't seem all that different from the existing tests...

kosloot commented 3 years ago

Your file was fine and didn't seem all that different from the existing tests...

it has 2 correction-annotation declarations, maybe that was the culprit?