LanguageMachines / libfolia

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

failed operations should not (always?) invalidate a FoLiA document #20

Closed kosloot closed 3 years ago

kosloot commented 6 years ago

Some operations, especially appending should leave the original document untouched. This enables users/programs to continue with the document, attempting other operations, like edit/save etc. At the moment preserving is probably not always the case, leaving a failed addition IN the document, rendering it invalid. Some code overhauling might be necessary. @proycon is the Python version robust against these problems ?

proycon commented 6 years ago

Not sure what you mean, failed appends would raise an exception, catching those enables programs to continue and attempt other things. So I'd say the python library is robust against it yes?

kosloot commented 6 years ago

Well, in libfolia I encountered a situation where append didn't throw but ab operation directly afterwards DID (notably checking if a Annotation Layer has the same set as the appended child) This is just a reminder/warning to check the code for this risk. for instance postappend() should NOT trow, OR revert the append().

checking the code in this respect might be wise.

kosloot commented 6 years ago

a more compelling example is text checking. This is postponed to the serializing step of FoLiA. When at that moment an error is detected, a roll-back is hardly possible. I think we have to (and can) live with that.

kosloot commented 3 years ago

closing this. It is acceptable to NOT detect all errors, as long a at the end at least one error is detected and NO invalid FoLiA is produced.