You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import random
from cassis import *
data = bytearray(random.getrandbits(8) for _ in range(8))
cas = Cas()
ByteArray = cas.typesystem.get_type("uima.cas.ByteArray")
ba = ByteArray(elements=list(data))
cas.add_annotation(ba)
print(ba)
print(cas.to_xmi(pretty_print=True))
Expected behavior
A clear and concise description of what you expected to happen.
Error message
Traceback (most recent call last):
File "C:/Users/klie/AppData/Roaming/JetBrains/PyCharm2021.2/scratches/cassis/Quechua/bita.py", line 16, in <module>
print(cas.to_xmi(pretty_print=True))
File "D:\git\dkpro-cassis\cassis\cas.py", line 522, in to_xmi
serializer.serialize(sink, self, pretty_print=pretty_print)
File "D:\git\dkpro-cassis\cassis\xmi.py", line 309, in serialize
self._serialize_feature_structure(cas, root, fs)
File "D:\git\dkpro-cassis\cassis\xmi.py", line 410, in _serialize_feature_structure
elements = " ".join(str(e.xmiID) for e in value)
File "D:\git\dkpro-cassis\cassis\xmi.py", line 410, in <genexpr>
elements = " ".join(str(e.xmiID) for e in value)
AttributeError: 'int' object has no attribute 'xmiID'
The text was updated successfully, but these errors were encountered:
* #167 - Cant serialize byte arrays
- Add function to check whether something is a primitive array
- Add basic support for serializing/deserializing primitive arrays
Describe the bug
Cant serialize byte arrays
To Reproduce
Expected behavior
A clear and concise description of what you expected to happen.
Error message
The text was updated successfully, but these errors were encountered: