Textractor API textractor-720 (20091120123250)

textractor.datamodel.annotation
Interface AnnotationSource

All Known Implementing Classes:
ArticleSingleTermAnnotationSource, DoubleTermAnnotation, SingleTermAnnotation, TextFragmentAnnotation

public interface AnnotationSource

A source of annotation information. Implementations of this interface do not need to be persistent in the way TextFragmentAnnotation is. The interface has all the methods needed to support the export of SVM features.


Field Summary
static int FIRST_TERM
           
static int SECOND_TERM
           
 
Method Summary
 void createIndexedTerms(DocumentIndexManager manager)
          Instructs this annotation to created indexed terms if they do not already exist.
 boolean getBooleanAnnotation(String annotationType)
          Obtain the annotation corresponding to the type.
 int getCenterPosition()
          Calculates and returns the center of the terms described in this annotation.
 String getCurrentText(DocumentIndexManager manager)
          Obtain the text of this annotation.
 int[] getIndexedTerms()
          Returns the text of this annotation in its indexed form.
 Sentence getSentence()
          Returns the sentence associated with this annotation.
 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.
 

Field Detail

FIRST_TERM

static final int FIRST_TERM
See Also:
Constant Field Values

SECOND_TERM

static final int SECOND_TERM
See Also:
Constant Field Values
Method Detail

getCurrentText

String getCurrentText(DocumentIndexManager manager)
Obtain the text of this annotation.

Parameters:
manager - The document manager that will be used to obtain the text.
Returns:
The text associated with this annotation.

getSentence

Sentence getSentence()
Returns the sentence associated with this annotation.

Returns:
The sentence associated with this annotation.

getIndexedTerms

int[] getIndexedTerms()
Returns the text of this annotation in its indexed form. In the indexed form, each term/word of the text is represented by an int.

Returns:
An array of indexed terms, in the order in which these terms occur in the text of this annotation.

getCenterPosition

int getCenterPosition()
Calculates and returns the center of the terms described in this annotation.

Returns:
The position of the "center" of this annotation.

createIndexedTerms

void createIndexedTerms(DocumentIndexManager manager)
Instructs this annotation to created indexed terms if they do not already exist.

Parameters:
manager - The document manager that will be used to obtain the indexed form of the terms.

getBooleanAnnotation

boolean getBooleanAnnotation(String annotationType)
Obtain the annotation corresponding to the type.

Parameters:
annotationType - The type of annotation that should be retrieved.
Returns:
The value of this annotation.

getTerm

AnnotatedTerm getTerm(int index)
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

int getTermNumber()
Returns the number of terms in this annotation.

Returns:
the number of terms in this annotation.

Textractor API textractor-720 (20091120123250)

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