Edward,
As a quick test, I tried using some test data for the
XCASDeserializerTest. This data can be found in
http://svn.apache.org/repos/asf/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/ExampleCas
The typesystem and CAS test data has been quite useful to flush out
XCAS/XMI serialization issues.
The XCAS data:
C:\temp\pycas-0.1>python
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycas
>>> cas = pycas.xml.load_cas('cas.xml', 'testTypeSystem.xml')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "pycas\xml.py", line 252, in load_cas
return parse_cas(etree, type_system, type_order)
File "pycas\xml.py", line 315, in parse_cas
_xcas_parse_fs_attribs(elt, fs, id_map, xcas_index)
File "pycas\xml.py", line 367, in _xcas_parse_fs_attribs
setattr(fs, fname[len(_XCAS_REF):], id_map.get(fval))
File "pycas\types.py", line 873, in __setattr__
object.__setattr__(self, attr, val)
File "pycas\types.py", line 774, in __set__
val = range_type.coerce(val, obj.cas)
File "pycas\types.py", line 1175, in coerce
for elt in reversed(list(val)):
TypeError: iteration over non-sequence
Another test, with an XMI format cas:
>>> cas = pycas.xml.load_cas('v1xmiCas.xml', 'testTypeSystem.xml')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "pycas\xml.py", line 252, in load_cas
return parse_cas(etree, type_system, type_order)
File "pycas\xml.py", line 312, in parse_cas
fs = _xmi_parse_fs_attribs(elt, fs, id_map)
File "pycas\xml.py", line 412, in _xmi_parse_fs_attribs
setattr(fs, fname, vals)
File "pycas\types.py", line 873, in __setattr__
object.__setattr__(self, attr, val)
File "pycas\types.py", line 780, in __set__
raise ValueError('Feature %s expected element type %s' %
ValueError: Feature org.apache.uima.testTypeSystem.AnnotationArrayTest:arrayOfAn
notations expected element type uima.tcas.Annotation
Regards,
Eddie