Exemplo n.º 1
0
        /// <summary>Extracts info about one relation mention</summary>
        private static AceEventMention ParseEventMention(INode node, AceDocument doc)
        {
            string     id     = GetAttributeValue(node, "ID");
            AceCharSeq extent = ParseCharSeq(GetChildByName(node, "extent"));
            AceCharSeq anchor = ParseCharSeq(GetChildByName(node, "anchor"));
            // create the mention
            AceEventMention mention = new AceEventMention(id, extent, anchor);
            // find the mention args
            IList <INode> args = GetChildrenByName(node, "event_mention_argument");

            foreach (INode arg in args)
            {
                string           role  = GetAttributeValue(arg, "ROLE");
                string           refid = GetAttributeValue(arg, "REFID");
                AceEntityMention am    = doc.GetEntityMention(refid);
                if (am != null)
                {
                    am.AddEventMention(mention);
                    mention.AddArg(am, role);
                }
            }
            return(mention);
        }