Package org.apache.uima.jcas.cas

Examples of org.apache.uima.jcas.cas.EmptyFSList


//        break; // stop if a gold pair is found
//      }else{
//        labeledAntecedent.setLabel(false);
//      }
    }
    if(tail == null) pairList.setAntecedentList(new EmptyFSList(jcas));
    else tail.setTail(new EmptyFSList(jcas));
    numVecs++;
    pairList.addToIndexes();   
  }
View Full Code Here


//        break; // stop if a gold pair is found
//      }else{
//        labeledAntecedent.setLabel(false);
//      }
    }
    if(tail == null) pairList.setAntecedentList(new EmptyFSList(jcas));
    else tail.setTail(new EmptyFSList(jcas));
    numVecs++;
    pairList.addToIndexes();
  }
View Full Code Here

//        break; // stop if a gold pair is found
//      }else{
//        labeledAntecedent.setLabel(false);
//      }
    }
    if(tail == null) pairList.setAntecedentList(new EmptyFSList(jcas));
    else tail.setTail(new EmptyFSList(jcas));
    numVecs++;
    pairList.addToIndexes();
  }
View Full Code Here

   */
  public static FSList buildList(JCas jcas, TOP[] objArr)
  {
    if (objArr.length == 0)
    {
      return new EmptyFSList(jcas);
    }
   
    NonEmptyFSList firstList = new NonEmptyFSList(jcas);
    NonEmptyFSList list = firstList;   
    for (int i=0; i < objArr.length; i++)
    {     
      list.setHead(objArr[i]);
      list.addToIndexes();
     
      if ((i+1) < objArr.length)
      {
        NonEmptyFSList nextList = new NonEmptyFSList(jcas);
        list.setTail(nextList);
        list = nextList;
      }
    }
   
    // set tail to empty list
    list.setTail(new EmptyFSList(jcas));   
   
    return firstList;
  }
View Full Code Here

        {
          if (!headIdToPredicate.containsKey(parserNode)) {
            // We have not encountered this predicate yet, so create it
            Predicate pred = this.createPredicate(jCas, rolesetId, token);
            headIdToPredicate.put(parserNode, pred);
            pred.setRelations(new EmptyFSList(jCas));
          }
        }
    }
   
   
View Full Code Here

      Token tok1 = new Token(jcas);
      Token tok2 = new Token(jcas);

      NonEmptyFSList fsList1 = new NonEmptyFSList(jcas);
      fsList1.setHead(tok2);
      fsList1.setTail(new EmptyFSList(jcas));
      NonEmptyFSList fsList = new NonEmptyFSList(jcas);
      fsList.setHead(tok1);
      fsList.setTail(fsList1);
      EmptyFSList emptyFsList = new EmptyFSList(jcas);

      try {
        emptyFsList.getNthElement(0);
        assertTrue(false); // error if we get here
      } catch (CASRuntimeException e) {
        assertTrue(e.getMessageKey().equals(CASRuntimeException.JCAS_GET_NTH_ON_EMPTY_LIST));
        System.out.print("Expected Error: ");
        System.out.println(e.getMessage());
View Full Code Here

      Token tok1 = new Token(jcas);
      Token tok2 = new Token(jcas);

      NonEmptyFSList fsList1 = new NonEmptyFSList(jcas);
      fsList1.setHead(tok2);
      fsList1.setTail(new EmptyFSList(jcas));
      NonEmptyFSList fsList = new NonEmptyFSList(jcas);
      fsList.setHead(tok1);
      fsList.setTail(fsList1);
      EmptyFSList emptyFsList = new EmptyFSList(jcas);

      try {
        emptyFsList.getNthElement(0);
        assertTrue(false); // error if we get here
      } catch (CASRuntimeException e) {
        assertTrue(e.getMessageKey().equals(CASRuntimeException.JCAS_GET_NTH_ON_EMPTY_LIST));
        System.out.print("Expected Error: ");
        System.out.println(e.getMessage());
View Full Code Here

      head.setHead(i.next());
      if (i.hasNext()) {
        head.setTail(new NonEmptyFSList(jCas));
        head = (NonEmptyFSList) head.getTail();
      } else {
        head.setTail(new EmptyFSList(jCas));
      }
    }

    // Print what is expected
    for (FeatureStructure fs : allFS) {
View Full Code Here

      head.setHead(i.next());
      if (i.hasNext()) {
        head.setTail(new NonEmptyFSList(jCas));
        head = (NonEmptyFSList) head.getTail();
      } else {
        head.setTail(new EmptyFSList(jCas));
      }
    }

    // Print what is expected
    for (FeatureStructure fs : allFS) {
View Full Code Here

    return asList(data.toArray(new Float[data.size()]));
  }

  public static FSList createFSList(JCas aJCas, Collection<? extends TOP> aCollection) {
    if (aCollection.isEmpty()) {
      return new EmptyFSList(aJCas);
    }

    NonEmptyFSList head = new NonEmptyFSList(aJCas);
    NonEmptyFSList list = head;
    Iterator<? extends TOP> i = aCollection.iterator();
    while (i.hasNext()) {
      head.setHead(i.next());
      if (i.hasNext()) {
        head.setTail(new NonEmptyFSList(aJCas));
        head = (NonEmptyFSList) head.getTail();
      } else {
        head.setTail(new EmptyFSList(aJCas));
      }
    }

    return list;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.jcas.cas.EmptyFSList

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.