Examples of OffsetComparator


Examples of gate.util.OffsetComparator

      AnnotationSet containingAnnotations = inputAS.get(containingAnnotationTypeName);
      //Iterator<Annotation> it = inputAnnotations.iterator();
      //String content = document.getContent().toString();

      List<Annotation> containingList = new ArrayList<Annotation>(containingAnnotations);
      Collections.sort(containingList,new OffsetComparator());
      for(Annotation containing : containingList) {
        // export the contained for the span covered by containing
        exportContainedAnnotations(outStream,containing.getStartNode().getOffset(),
                containing.getEndNode().getOffset(),inputAS);
      }
View Full Code Here

Examples of gate.util.OffsetComparator

  protected boolean exportContainedAnnotations(PrintStream outStream, Long from, Long to,
          AnnotationSet inputAS) {
    AnnotationSet filteredAS = inputAS.get(containedAnnotationTypeName,from,to);
    List<Annotation> filteredList = new ArrayList<Annotation>(filteredAS);
    Collections.sort(filteredList,new OffsetComparator());
    boolean haveSomething = false;
    for(Annotation ann : filteredList) {
      String toExport;
      if(featureName == null || featureName.equals("")) {
        toExport = Utils.stringFor(document, ann);
View Full Code Here

Examples of gate.util.OffsetComparator

      //interate on tokens
     
      java.util.List<Annotation> tokenslist = new java.util.LinkedList<gate.Annotation>(annotations.get("Token", sentence.getStartNode().getOffset(), sentence.getEndNode().getOffset()));
     
      //sort them
      Collections.sort(tokenslist, new OffsetComparator());
      //make the string list
      String[] tokens = new String[tokenslist.size()];
      int k = 0;
      for (Annotation token : tokenslist) {
        tokens[k] = (String)token.getFeatures().get("string");
View Full Code Here

Examples of gate.util.OffsetComparator

    String perType = "person";

    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
    ArrayList<Annotation> tokens, dToks, lToks, oToks, pToks;
View Full Code Here

Examples of gate.util.OffsetComparator

    Factory.deleteResource(pipeline);

    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
    ArrayList<Annotation> tokens;
View Full Code Here

Examples of gate.util.OffsetComparator

    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    Alphabet labelAlphabet = tagger.getYAlphabet();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    int[] labels;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
View Full Code Here

Examples of gate.util.OffsetComparator

    Factory.deleteResource(pipeline);

    // extract sentences from text
    ArrayList<Annotation> sentences = new ArrayList(inputAS
        .get(sequenceType));
    OffsetComparator oc = new OffsetComparator();
    Collections.sort(sentences, oc);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    ArrayList<Annotation> tokens;
    SparseVector[] x;
    Object[] y;
View Full Code Here

Examples of gate.util.OffsetComparator

    String vChunkType = "vchunk";

    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
    ArrayList<Annotation> tokens, nToks, vToks;
View Full Code Here

Examples of gate.util.OffsetComparator

   
    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    Alphabet labelAlphabet = tagger.getYAlphabet();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    int[] labels;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
View Full Code Here

Examples of gate.util.OffsetComparator

    // extract sentences from text
    AnnotationSet sentences = inputAS.get(sequenceType);
    ArrayList<Element<Object>> elements = new ArrayList<Element<Object>>();
    Alphabet labelAlphabet = tagger.getYAlphabet();
    OffsetComparator oc = new OffsetComparator();
    SparseVector[] x;
    Object[] y;
    int[] labels;
    ElementSequence<Element<Object>> sequence;
    Element<Object> element;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.