dkpro / dkpro-cassis

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

Transitively referenced primitive arrays not returned by _find_all_fs #185

Closed reckart closed 2 years ago

reckart commented 2 years ago

Describe the bug Transitively referenced primitive arrays not returned by cas._find_all_fs().

To Reproduce

def test_scanning_for_transitively_referenced_integer_array():
    typesystem = TypeSystem()
    Foo = typesystem.create_type("Foo")
    typesystem.create_feature(
        Foo,
        "ref",
        rangeTypeName="uima.cas.IntegerArray",
        elementType="uima.cas.Integer",
        multipleReferencesAllowed=True,
    )

    cas = Cas(typesystem)

    foo = Foo()
    cas.add(foo)

    IntegerArray = typesystem.get_type("uima.cas.IntegerArray")
    int_array = IntegerArray()
    int_array.elements = [1, 2, 3]
    foo.ref = int_array

    all_fs = list(cas._find_all_fs())

    assert int_array in all_fs

Expected behavior All feature structures should be returned by cas._find_all_fs()

Please complete the following information: