Search in sources :

Example 1 with CASException

use of org.apache.uima.cas.CASException in project lucene-solr by apache.

the class UIMATypeAwareAnnotationsTokenizer method initializeIterator.

@Override
protected void initializeIterator() throws IOException {
    try {
        analyzeInput();
    } catch (AnalysisEngineProcessException | ResourceInitializationException e) {
        throw new IOException(e);
    }
    featurePath = cas.createFeaturePath();
    try {
        featurePath.initialize(typeAttributeFeaturePath);
    } catch (CASException e) {
        featurePath = null;
        throw new IOException(e);
    }
    finalOffset = correctOffset(cas.getDocumentText().length());
    Type tokenType = cas.getTypeSystem().getType(tokenTypeString);
    iterator = cas.getAnnotationIndex(tokenType).iterator();
}
Also used : Type(org.apache.uima.cas.Type) ResourceInitializationException(org.apache.uima.resource.ResourceInitializationException) IOException(java.io.IOException) CASException(org.apache.uima.cas.CASException) AnalysisEngineProcessException(org.apache.uima.analysis_engine.AnalysisEngineProcessException)

Aggregations

IOException (java.io.IOException)1 AnalysisEngineProcessException (org.apache.uima.analysis_engine.AnalysisEngineProcessException)1 CASException (org.apache.uima.cas.CASException)1 Type (org.apache.uima.cas.Type)1 ResourceInitializationException (org.apache.uima.resource.ResourceInitializationException)1