Esempio n. 1
0
        public override string ToXml(int offset)
        {
            StringBuilder buffer      = new StringBuilder();
            string        mentionType = mType;

            AppendOffset(buffer, offset);
            buffer.Append("<entity_mention ID=\"" + GetId() + "\" TYPE =\"" + mentionType + "\" LDCTYPE=\"" + mLdctype + "\">\n");
            buffer.Append(mExtent.ToXml("extent", offset + 2));
            buffer.Append("\n");
            buffer.Append(mHead.ToXml("head", offset + 2));
            buffer.Append("\n");
            AppendOffset(buffer, offset);
            buffer.Append("</entity_mention>");
            if (mentionType.Equals("NAM"))
            {
                // XXX: <entity_attributes> should be in Entity.toXml()
                buffer.Append("\n");
                AppendOffset(buffer, offset);
                buffer.Append("<entity_attributes>\n");
                AppendOffset(buffer, offset + 2);
                buffer.Append("<name NAME=\"" + mHead.GetText() + "\">\n");
                buffer.Append(mHead.ToXml(offset + 4) + "\n");
                AppendOffset(buffer, offset + 2);
                buffer.Append("</name>\n");
                AppendOffset(buffer, offset);
                buffer.Append("</entity_attributes>");
            }
            return(buffer.ToString());
        }
        public virtual string ToXml(int offset)
        {
            StringBuilder buffer = new StringBuilder();

            AceElement.AppendOffset(buffer, offset);
            buffer.Append("<" + mentionType + "_mention_argument REFID=\"" + mContent.GetId() + "\" ROLE=\"" + mRole + "\">\n");
            //buffer.append(getContent().toXml(offset + 2));
            AceCharSeq ext = GetContent().GetExtent();

            buffer.Append(ext.ToXml("extent", offset + 2));
            buffer.Append("\n");
            AceElement.AppendOffset(buffer, offset);
            buffer.Append("</" + mentionType + "_mention_argument>");
            return(buffer.ToString());
        }