-
Notifications
You must be signed in to change notification settings - Fork 39
Description
It looks very much like any BioEventMention or CorefEventMention that is deserialized is forced to have a BioTextBoundMention or CorefTextBoundMention as a trigger:
reach/main/src/main/scala/org/clulab/reach/mentions/serialization/json/JSONSerializer.scala
Line 91 in c7397a4
| toBioMention(mjson \ "trigger", docMap).toBioMention.asInstanceOf[BioTextBoundMention], |
reach/main/src/main/scala/org/clulab/reach/mentions/serialization/json/JSONSerializer.scala
Line 198 in c7397a4
| toCorefMention(mjson \ "trigger", docMap).toCorefMention.asInstanceOf[CorefTextBoundMention], |
However, when the BioEventMention or CorefEventMention is created, the TextBoundMention in the trigger is not converted similarly:
| m.trigger, |
| m.trigger, |
This might cause many problems, but one is that a serialized and then deserialized Bio- or CorefEventMention will have its trigger change type from a simple TextBoundMention to a more specific one so that the round trip is essentially invalid. A newly enabled but old test confirms this.
Those lines should probably be changed to
m.trigger.toBioMention.asInstanceOf[BioTextBoundMention],and
m.trigger.toCorefMention.asInstanceOf[CorefTextBoundMention],It would be good for others who know more about this project to confirm the intention of the original design and consider whether the change would cause problems. Thanks.
FYI @enoriega, @MihaiSurdeanu