Package org.apache.uima.examples.opennlp

Examples of org.apache.uima.examples.opennlp.SyntaxAnnotation


      // make the annotation
      int start = offsetMap.getMapping(span.getStart());
      int end = offsetMap.getMapping(span.getEnd());
      Constructor annotationMaker = (Constructor) parseTagMap.get(tag);
      if (annotationMaker != null) {
        SyntaxAnnotation syntaxAnnot;
        try {
          syntaxAnnot = (SyntaxAnnotation) annotationMaker.newInstance(new Object[] { jCas });
        } catch (Exception e) {
          throw new AnalysisEngineProcessException(e);
        }
        syntaxAnnot.setBegin(start);
        syntaxAnnot.setEnd(end);
        syntaxAnnot.setComponentId(COMPONENT_NAME);
        syntaxAnnot.addToIndexes();
      }
      Parse[] children = parse.getChildren();
      for (int i = 0; i < children.length; i++) {
        makeAnnotations(children[i], jCas);
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.examples.opennlp.SyntaxAnnotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.