Open mssammon opened 7 years ago
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
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.
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.
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