
de.citec.scie.web.analysis.AbstractAnalysisResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webservice Show documentation
Show all versions of webservice Show documentation
Module providing the webservice interface based on the Jetty
embedded webserver and the FreeMarker template engine. Defines a simple
format for providing textual annotations and produced output in HTML or
JSON. This module has no dependencies to the other SCIE modules (except
for the PDF text extractor) or the UIMA framework and thus can be used
in any context, where text is annotated by an algorithm and should be
presented to an end user.
The newest version!
/*
* SCIE -- Spinal Cord Injury Information Extraction
* Copyright (C) 2013, 2014
* Raphael Dickfelder, Jan Göpfert, Benjamin Paaßen, Andreas Stöckel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package de.citec.scie.web.analysis;
/**
* Interface which allows an exporter to access the annotations that were
* produced by the system.
*
* @author Andreas Stöckel -- [email protected]
*/
public interface AbstractAnalysisResult {
/**
* Returns the document text all annotation positions are relative to.
*
* @return the document text.
*/
public String getText();
/**
* Returns the annotation count.
*/
public int getAnnotationCount();
/**
* Returns the begin of the annotation relative to the analyzed text.
*
* @param idx is the index of the annotation between 0 and count of
* annotations minus one.
* @return the begin position in characters.
*/
public int getAnnotationBegin(int idx);
/**
* Returns the end of the annotation relative to the analyzed text.
*
* @param idx is the index of the annotation between 0 and count of
* annotations minus one.
* @return the end position in characters.
*/
public int getAnnotationEnd(int idx);
/**
* Returns the id of the group the annotation belongs to.
*
* @param idx is the index of the annotation between 0 and count of
* annotations minus one.
* @return the id of the group this annotation belongs to.
*/
public int getAnnotationGroupId(int idx);
/**
* Returns the name of the annotation.
*
* @param idx is the index of the annotation between 0 and count of
* annotations minus one.
* @return the name of the annotation.
*/
public String getAnnotationName(int idx);
/**
* Returns the data associated with the annotation.
*
* @param idx is the index of the annotation between 0 and count of
* annotations minus one.
* @return the data associated with the annotation.
*/
public AnnotationData getAnnotationData(int idx);
/**
* Returns the name of the given annotation group.
*
* @param gid is an annotation group id as returned by the
* getAnnotationGroupId function.
* @return the name of the annotation group.
*/
public String getGroupName(int gid);
/**
* Returns whether the given annotation group is preselected.
*
* @param gid is an annotation group id as returned by the
* getAnnotationGroupId function.
* @return true if the group is preselected in the viewer.
*/
default public boolean getGroupPreselected(int gid) {
return true;
}
/**
* Returns the name of the parent group. Annotation groups are grouped into
* higher-level categories according to this name. The result may be null.
*
* @param gid is an annotation group id as returned by the
* getAnnotationGroupId function.
* @return the group category or null.
*/
default public String getGroupCategory(int gid) {
return null;
}
/**
* Returns the HSL hue the group should be viewed with or null.
*
* @param gid is an annotation group id as returned by the
* getAnnotationGroupId function.
* @return the HSL hue the group or null if the hue should be chosen
* automatically.
*/
default public Integer getGroupHue(int gid) {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy