dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
85 stars 22 forks source link

while deserializing xmi: AttributeError ... object has no attribute 'sofa #60

Closed Br0ce closed 5 years ago

Br0ce commented 5 years ago

deserializing xmi with myType and its supertypeName=uima.cas.TOP an AttributeError: myType object has no attribute 'sofa' ... /cassis/cas.py", line 169, in add_annotation annotation.sofa = self.get_sofa().xmiID

is raised.

(Please note that processing xmi in java is not an issue)

jcklie commented 5 years ago

Hello, thank you for using cassis and reporting this issue. Can you tell me which version you are using and send me a minimal typesystem and CAS which triggers the bug?

reckart commented 5 years ago

uima.cas.TOP doesn't have a feature called sofa - it is only introduced by uima.cas.AnnotationBase.

Br0ce commented 5 years ago

Thx for fast reply,

I will assemble a minimal typesystem.

Meanwhile, with regard to @reckart, it should not be an AttributeError, that Type uima.cas.TOP doesn't have an attribute sofa.

( In this case, as far as I can see, in Cas.add_annotations if hasattr(annotation, "sofa"): should be False )

Br0ce commented 5 years ago

Hi @jcklie, I'm using dkpro-cassis version 0.1.1. Attached to this post is a TypesSystem and a XMI (extended filename by .txt to support upload). Deserializing the XMI raises the AttributeError. Thx TypeSystem.xml.txt Example.cas.xmi.txt

jcklie commented 5 years ago

In 0.2.0-rc1, this works for me except that you redefine DocumentAnnotation, which I need to fix (see #12).

Br0ce commented 5 years ago

Ah, ok. All good now. Thank you.

jcklie commented 5 years ago

I will fix #12 this week or so and then you can try the next release candidate.

Br0ce commented 5 years ago

appreciate!