cogcomp-nlp icon indicating copy to clipboard operation
cogcomp-nlp copied to clipboard

remove TextAnnotation.sentences

Open mssammon opened this issue 8 years ago • 3 comments

We have an explicit sentence view: make sure it is written out when serialized, and that it is read when deserialized. Remove TextAnnotation.sentences as Sentence data structure creates potential inconsistencies due to having its own views, in spite of holding a reference to a TextAnnotation object

mssammon avatar Mar 31 '17 17:03 mssammon

I found a relatively good usage for Sentence datastructure:
https://gitlab-beta.engr.illinois.edu/cogcomp/illinois-comma-srl/blob/master/src/main/lbj/CommaClassifier.lbj#L199-282

danyaljj avatar Apr 04 '17 06:04 danyaljj

modified to separate the two issues. The sentences field still bothers me as it has created problems when end users accessed .sentences instead of the containing TextAnnotation, but maybe this is more a documentation issue.

mssammon avatar Jun 11 '18 20:06 mssammon

Just reasserting my vote to remove this duplicative field: changing the Sentence view requires an explicit call to TextAnnotation.setSentences() to update the .sentences field; if you forget, the TextAnnotation has inconsistent state between the view and the .sentences field. This affects e.g. the TextAnnotation.equals() behavior.

mssammon avatar Jun 11 '18 22:06 mssammon