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

Cas.add() should be able to accept multiple feature structures #274

Closed reckart closed 1 year ago

reckart commented 1 year ago

Is your feature request related to a problem? Please describe. Cas.add() should be able to accept multiple feature structures. It is annoying if I have multiple feature structures and need to call add separately for each of them.

ann1 = Annotation(...)
ann2 = Annotation(...)
ann3 = Annotation(...)
cas.add(ann1)
cas.add(ann2)
cas.add(ann3)

Describe the solution you'd like Ability to pass an iterable and add all items at once:

ann1 = Annotation(...)
ann2 = Annotation(...)
ann3 = Annotation(...)
cas.add([ann1, ann2, ann3])

Describe alternatives you've considered Add a method to the feature structure classes to add them to a cas, e.g. ann1.add_to(cas) - but that might conflict with feature names.

reckart commented 1 year ago

We already have a cas.add_all(), so this is not needed.