Package gate.annotation

Examples of gate.annotation.AnnotationSetImpl


  // This allows to link prefix, suffix and lookup annotations by their IDs
  protected Integer addAnAnnotation(Document theDocument,
    AnnotationSet set, int from, int to, String type, FeatureMap fm) {
    Integer id = null;
    if (set instanceof AnnotationSetImpl) {
      AnnotationSetImpl setasannimpl = (AnnotationSetImpl) set;
      try {
        id = setasannimpl.add(new Long(from), new Long(to), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + theDocument.getContent().size() + "/" + from + "/" + to, ex);
      }
    } else {
View Full Code Here


    if(debug) {
      //System.out.println("Trying to add annotation from "+from+" to "+to+" fm="+fm);
    }
    Integer id = null;
    if (outputAS instanceof AnnotationSetImpl) {
      AnnotationSetImpl setasannimpl = (AnnotationSetImpl) outputAS;
      try {
        id = setasannimpl.add(new Long(from), new Long(to+1), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + document.getContent().size() + "/" + from + "/" + to, ex);
      }
    } else {
View Full Code Here

  // This allows to link prefix, suffix and lookup annotations by their IDs
  protected Integer addAnAnnotation(Document theDocument,
    AnnotationSet set, int from, int to, String type, FeatureMap fm) {
    Integer id = null;
    if (set instanceof AnnotationSetImpl) {
      AnnotationSetImpl setasannimpl = (AnnotationSetImpl) set;
      try {
        id = setasannimpl.add(new Long(from), new Long(to), type, fm);
      } catch (InvalidOffsetException ex) {
        throw new GateRuntimeException("Invalid offset exception - doclen/from/to="
          + theDocument.getContent().size() + "/" + from + "/" + to, ex);
      }
    } else {
View Full Code Here

    // set the input annotation set
    if ((inputASName != null) && (inputASName.length() > 0))
      inputAS = document.getAnnotations(inputASName);
    else
      inputAS = document.getAnnotations();
    outputAS = new AnnotationSetImpl(document, outputASName);
    // load the pipeline, extractor and tagger from file
    ObjectInputStream in;
    if (loadPath.endsWith(".gz"))
      in = new ObjectInputStream(new GZIPInputStream(new FileInputStream(
          loadPath)));
View Full Code Here

TOP

Related Classes of gate.annotation.AnnotationSetImpl

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.