public Topic newTopic(String label, float probability) { String newId = idManager.topics.getNext(); Topic t = new Topic(newId); t.setLabel(label); t.setProbability(probability); annotationContainer.add(t); return t; }
for (Topic topic : topics) { Element topicElem = new Element("topic"); topicElem.setText(topic.getTopicValue()); if (topic.hasSource()) { topicElem.setAttribute("source", topic.getSource()); if (topic.hasMethod()) { topicElem.setAttribute("method", topic.getMethod()); if (topic.hasURI()) { topicElem.setAttribute("uri", topic.getURI()); if (topic.hasConfidence()) { topicElem.setAttribute("confidence", Double.toString(topic.getConfidence()));
public Topic newTopic(String value) { Topic newTopic = new Topic(value); annotationContainer.add(newTopic, Layer.TOPICS, AnnotationType.TOPIC); return newTopic; }
for (Topic t : topics) { Element topicElement = new Element("topic"); topicElement.setAttribute("label", t.getLabel()); topicElement.setAttribute("probability", Float.toString(t.getProbability())); topicLayer.addContent(topicElement);
/** * Creates a Topic object and add it to the document * * @param term the Term of the coreference. * @return a new factuality. */ public Topic newTopic() { String newId = idManager.topics.getNext(); Topic t = new Topic(newId); annotationContainer.add(t); return t; }