Textractor API textractor-720 (20091120123250)

textractor.datamodel.annotation
Class SingleTermAnnotation

java.lang.Object
  extended by textractor.datamodel.annotation.TextFragmentAnnotation
      extended by textractor.datamodel.annotation.SingleTermAnnotation
All Implemented Interfaces:
AnnotationSource

public final class SingleTermAnnotation
extends TextFragmentAnnotation

Stores single annotation about a text fragment. Annotation is produced by humans and entered into the database. This class supports this _process. example: --- 1 --- A:protein < enter ... Created by IntelliJ IDEA. User: lshi Date: Apr 6, 2004 Time: 11:18:29 AM To change this template use File | Settings | File Templates.


Field Summary
static String ANNOTATION_MULTICLASS
           
static String ANNOTATION_MUTATION
           
static String ANNOTATION_PROTEIN
           
static int INT_ANNOTATION_MULTICLASS
           
static int INT_ANNOTATION_MUTATION
           
static int INT_ANNOTATION_PROTEIN
           
 
Fields inherited from interface textractor.datamodel.annotation.AnnotationSource
FIRST_TERM, SECOND_TERM
 
Constructor Summary
SingleTermAnnotation()
          Creates a new Single Term Annotation.
SingleTermAnnotation(int annotationBatch, int annotationNumber)
           
 
Method Summary
 Object2IntMap<String> getAnnotationMap()
           
 int getCenterPosition()
          Calculates and returns the center of the terms described in this annotation.
 String getStringType()
          Returns the type of this annotation as a String.
 AnnotatedTerm getTerm()
           
 AnnotatedTerm getTerm(int index)
          Returns one of the terms that are the focus of this annotation.
 int getTermNumber()
          Returns the number of terms in this annotation.
 
Methods inherited from class textractor.datamodel.annotation.TextFragmentAnnotation
createAnnotatedTerm, createIndexedTerms, getAnnotation, getAnnotationBatchNumber, getAnnotationNumber, getBooleanAnnotation, getBooleanAnnotation, getCurrentText, getIndexedTerms, getIsSingleTerm, getSentence, getSpaceDelimitedIndexFormatTerms, isAnnotationImported, isSet, isUseSentenceText, setAnnotation, setAnnotation, setAnnotationImported, setCurrentText, setIndexedTerms, setIsSingleTerm, setSentence, setUseSentenceText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANNOTATION_MUTATION

public static final String ANNOTATION_MUTATION
See Also:
Constant Field Values

ANNOTATION_PROTEIN

public static final String ANNOTATION_PROTEIN
See Also:
Constant Field Values

ANNOTATION_MULTICLASS

public static final String ANNOTATION_MULTICLASS
See Also:
Constant Field Values

INT_ANNOTATION_MUTATION

public static final int INT_ANNOTATION_MUTATION
See Also:
Constant Field Values

INT_ANNOTATION_PROTEIN

public static final int INT_ANNOTATION_PROTEIN
See Also:
Constant Field Values

INT_ANNOTATION_MULTICLASS

public static final int INT_ANNOTATION_MULTICLASS
See Also:
Constant Field Values
Constructor Detail

SingleTermAnnotation

public SingleTermAnnotation()
Creates a new Single Term Annotation.


SingleTermAnnotation

public SingleTermAnnotation(int annotationBatch,
                            int annotationNumber)
Method Detail

getTerm

public AnnotatedTerm getTerm()

getStringType

public String getStringType()
Description copied from class: TextFragmentAnnotation
Returns the type of this annotation as a String. returns protein for SingleTermAnnotations when the term is annotated as a protein, mutation when the term is annotated as a mutation.

Specified by:
getStringType in class TextFragmentAnnotation
Returns:
The type of this annotation

getCenterPosition

public int getCenterPosition()
Calculates and returns the center of the terms described in this annotation. For single term annotations, the center is the position of the term itself.

Returns:
The position of the term in the text of this annotation.

getTerm

public AnnotatedTerm getTerm(int index)
Description copied from interface: AnnotationSource
Returns one of the terms that are the focus of this annotation.

Parameters:
index - Index of the term in this annotation.
Returns:
The term at this index in this annotation.

getTermNumber

public int getTermNumber()
Description copied from interface: AnnotationSource
Returns the number of terms in this annotation.

Returns:
the number of terms in this annotation.

getAnnotationMap

public Object2IntMap<String> getAnnotationMap()
Specified by:
getAnnotationMap in class TextFragmentAnnotation

Textractor API textractor-720 (20091120123250)

Copyright © 2003-2008 Institute for Computational Biomedicine, All Rights Reserved.