private static Element toXML(EntityMention entity, String curNS) { Element top = new Element("entity", curNS); top.addAttribute(new Attribute("id", entity.getObjectId())); Element type = new Element("type", curNS); type.appendChild(entity.getType()); top.appendChild(entity.getType()); if (entity.getNormalizedName() != null){ Element nm = new Element("normalized", curNS); nm.appendChild(entity.getNormalizedName()); top.appendChild(nm); } if (entity.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(entity.getSubType()); top.appendChild(subtype); } Element span = new Element("span", curNS); span.addAttribute(new Attribute("start", Integer.toString(entity.getHeadTokenStart()))); span.addAttribute(new Attribute("end", Integer.toString(entity.getHeadTokenEnd()))); top.appendChild(span); top.appendChild(makeProbabilitiesElement(entity, curNS)); return top; }
private static Element toXML(RelationMention relation, String curNS) { Element top = new Element("relation", curNS); top.addAttribute(new Attribute("id", relation.getObjectId())); Element type = new Element("type", curNS); type.appendChild(relation.getType()); top.appendChild(relation.getType()); if (relation.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(relation.getSubType()); top.appendChild(relation.getSubType()); } List<EntityMention> mentions = relation.getEntityMentionArgs(); Element args = new Element("arguments", curNS); for (EntityMention e : mentions) { args.appendChild(toXML(e, curNS)); } top.appendChild(args); top.appendChild(makeProbabilitiesElement(relation, curNS)); return top; }
private static Element toXML(EntityMention entity, String curNS) { Element top = new Element("entity", curNS); top.addAttribute(new Attribute("id", entity.getObjectId())); Element type = new Element("type", curNS); type.appendChild(entity.getType()); top.appendChild(entity.getType()); if (entity.getNormalizedName() != null){ Element nm = new Element("normalized", curNS); nm.appendChild(entity.getNormalizedName()); top.appendChild(nm); } if (entity.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(entity.getSubType()); top.appendChild(subtype); } Element span = new Element("span", curNS); span.addAttribute(new Attribute("start", Integer.toString(entity.getHeadTokenStart()))); span.addAttribute(new Attribute("end", Integer.toString(entity.getHeadTokenEnd()))); top.appendChild(span); top.appendChild(makeProbabilitiesElement(entity, curNS)); return top; }
private static Element toXML(EntityMention entity, String curNS) { Element top = new Element("entity", curNS); top.addAttribute(new Attribute("id", entity.getObjectId())); Element type = new Element("type", curNS); type.appendChild(entity.getType()); top.appendChild(entity.getType()); if (entity.getNormalizedName() != null){ Element nm = new Element("normalized", curNS); nm.appendChild(entity.getNormalizedName()); top.appendChild(nm); } if (entity.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(entity.getSubType()); top.appendChild(subtype); } Element span = new Element("span", curNS); span.addAttribute(new Attribute("start", Integer.toString(entity.getHeadTokenStart()))); span.addAttribute(new Attribute("end", Integer.toString(entity.getHeadTokenEnd()))); top.appendChild(span); top.appendChild(makeProbabilitiesElement(entity, curNS)); return top; }
private static Element toXML(RelationMention relation, String curNS) { Element top = new Element("relation", curNS); top.addAttribute(new Attribute("id", relation.getObjectId())); Element type = new Element("type", curNS); type.appendChild(relation.getType()); top.appendChild(relation.getType()); if (relation.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(relation.getSubType()); top.appendChild(relation.getSubType()); } List<EntityMention> mentions = relation.getEntityMentionArgs(); Element args = new Element("arguments", curNS); for (EntityMention e : mentions) { args.appendChild(toXML(e, curNS)); } top.appendChild(args); top.appendChild(makeProbabilitiesElement(relation, curNS)); return top; }
private static Element toXML(RelationMention relation, String curNS) { Element top = new Element("relation", curNS); top.addAttribute(new Attribute("id", relation.getObjectId())); Element type = new Element("type", curNS); type.appendChild(relation.getType()); top.appendChild(relation.getType()); if (relation.getSubType() != null){ Element subtype = new Element("subtype", curNS); subtype.appendChild(relation.getSubType()); top.appendChild(relation.getSubType()); } List<EntityMention> ents = relation.getEntityMentionArgs(); Element args = new Element("arguments", curNS); for (EntityMention e : ents) { args.appendChild(toXML(e, curNS)); } top.appendChild(args); top.appendChild(makeProbabilitiesElement(relation, curNS)); return top; }