Examples of FSList


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

          FeatureStructure fsElement = fsa.get(i);
          if (fsElement != null)
            listFS.add(fsElement);
        }
      } else if (fsc instanceof FSList) {
        FSList fsl = (FSList) fsc;
        while (fsl instanceof NonEmptyFSList) {
          FeatureStructure fsElement = ((NonEmptyFSList) fsl)
              .getHead();
          if (fsElement != null)
            listFS.add(fsElement);
View Full Code Here

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

      MarkablePairSet pair = (MarkablePairSet) iter.next();
      Markable anaphor = pair.getAnaphor();
      String corefType = (anaphor instanceof NEMarkable ? CorefConsts.NE : (anaphor instanceof DemMarkable ? CorefConsts.DEM : CorefConsts.PRON));
      //      String nodeStr = vec.getVector();
      //      int label = getLabel(nodeStr);
      FSList pairList = pair.getAntecedentList();
      while(pairList instanceof NonEmptyFSList){
        NonEmptyFSList node = (NonEmptyFSList) pairList;
        BooleanLabeledFS labeledProb = (BooleanLabeledFS) node.getHead();
        int label = labeledProb.getLabel() ? 1 : 0;
//        if(anaphora){
View Full Code Here

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

        lemma.setPosTag(pos);
        lemmas.add(lemma);
      }
    }
    Lemma[] lemmaArray = (Lemma[]) lemmas.toArray(new Lemma[lemmas.size()]);
    FSList fsList = ListFactory.buildList(jcas, lemmaArray);
    wordAnnotation.setLemmaEntries(fsList);
  }
View Full Code Here

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

        pred = entRel.getPredicate();
        String feat = "pred:" + pred.getCoveredText().replace(' ', '_').toLowerCase();
        feats.add(feat);

        // get the relation this arg belongs to, then its predicate, then the other arguments (via relations)
        FSList rels = entArg.getRelation().getPredicate().getRelations();
        while(rels instanceof NonEmptyFSList){
          NonEmptyFSList node = (NonEmptyFSList) rels;
          SemanticRoleRelation curRel = (SemanticRoleRelation) node.getHead();
          SemanticArgument curArg =  curRel.getArgument();
          if(entArg.getCoveredText().equals(curArg.getCoveredText())){
View Full Code Here

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

        lemma.setPosTag(pos);
        lemmas.add(lemma);
      }
    }
    Lemma[] lemmaArray = (Lemma[]) lemmas.toArray(new Lemma[lemmas.size()]);
    FSList fsList = ListFactory.buildList(jcas, lemmaArray);
    wordAnnotation.setLemmaEntries(fsList);
  }
View Full Code Here

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

     
    FSIterator<Annotation> iter = jcas.getAnnotationIndex(MarkablePairSet.type).iterator();
    while(iter.hasNext()){
      MarkablePairSet set = (MarkablePairSet) iter.next();
      Markable anaphor = set.getAnaphor();
      FSList fs = (FSList) set.getAntecedentList();
      MarkableProb bestAnte = null;
      LinkedList<Markable> ll = fs2ll(fs);
      if(anaphor instanceof PronounMarkable){
        // There is not enough training data to do this reliably... the
        // classifier for this type will decrease scores
View Full Code Here

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

        relation.addToIndexes();
        relations.add(relation);
        argument.setRelation(relation);
      }
     
      FSList relationsList = ListFactory.buildList(jCas, relations.toArray(new TOP[relations.size()]));
      predicate.setRelations(relationsList);
    }
  }
View Full Code Here

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

  // Using TOP here because FSList is only available in the JCas.
  public static Collection<TOP> create(FSList aList, Type type) {
    TypeSystem ts = aList.getCAS().getTypeSystem();
    List<FeatureStructure> data = new ArrayList<FeatureStructure>();
    FSList i = aList;
    while (i instanceof NonEmptyFSList) {
      NonEmptyFSList l = (NonEmptyFSList) i;
      TOP value = l.getHead();
      if (value != null && (type == null || ts.subsumes(type, value.getType()))) {
        data.add(l.getHead());
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.