Overview   Class List   Class Hierarchy   Class Members   Functions & Constants   Defines   Header Files  

Predefined Indexes


Detailed Description

Only very few applications and annotators will need to create specific indexes that are optimized for special iteration needs.

Most applications and annotators will be just use some some "natural" way to iterate over the data in the feature structures in the FSStore.

For annotation feature structures this is the linear text order with some special sorting for annotations that start at the same position in the text.

For vocabulary feature structures a sort order based on lemma string and part of speech is the most accepted one.

Those "natural" indexes are predefined in the CAS and can be accessed using the functions described here.

For example to access tokens using the index over token annotations write:

 Type tokType = cas.getTypeSystem().getType(TT::TYPE_NAME_TOKEN_ANNOTATION);
 ANIndex tokIdx = cas.getAnnotationIndex(tokType);
 ANIterator tokIter = tokIdx.iterator();
 while(tokIter.isValid()) {
    AnnotationFS tokFS = tokIter.get();
    // ... do some processing with tokFS ...
    tokIter.moveToNext();
 }
 


Access to predefined indexes

virtual ANIndex uima::CAS::getAnnotationIndex ()
 get the index over all annotations.
virtual ANIndex uima::CAS::getAnnotationIndex (Type const &crType)
 get the index over annotations of type crType.
virtual ANIndex const uima::CAS::getAnnotationIndex (Type const &crType) const


Function Documentation

virtual ANIndex uima::CAS::getAnnotationIndex  )  [virtual, inherited]
 

get the index over all annotations.

The index is ordered where an annotation a1 is considered "less-than" another annotation a2 if the begin position of a1 is less then the begin position of a2, or, if they are equal, a1 is shorter than a2.

Exceptions:
InvalidFSTypeObjectException 

virtual ANIndex uima::CAS::getAnnotationIndex Type const &  crType  )  [virtual, inherited]
 

get the index over annotations of type crType.

The index is ordered where an annotation a1 is considered "less-than" another annotation a2 if the begin position of a1 is less then the begin position of a2, or, if they are equal, a1 is shorter than a2.

Parameters:
crType The returned index will return only annoations of type crType. crType must be derived from our annotation type.
Exceptions:
InvalidFSTypeObjectException 

virtual ANIndex const uima::CAS::getAnnotationIndex Type const &  crType  )  const [virtual, inherited]
 


Generated on Mon Oct 1 16:04:12 2012 for UIMACPP API by  doxygen 1.3.9.1