Examples of FSMatchConstraint


Examples of org.apache.uima.cas.FSMatchConstraint

      FSIterator it = cas.getAnnotationIndex(tokenType).iterator();
      FSStringConstraint type1Constraint = cas.getConstraintFactory().createStringConstraint();
      type1Constraint.equals(lemma);
      FeaturePath path = cas.createFeaturePath();
      path.addFeature(lemmaFeat);
      FSMatchConstraint cons = cas.getConstraintFactory().embedConstraint(path, type1Constraint);
      it = cas.createFilteredIterator(it, cons);

      int count = 0;
      for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
        ++count;
View Full Code Here

Examples of org.apache.uima.cas.FSMatchConstraint

      FSIterator it = cas.getAnnotationIndex(tokenType).iterator();
      FSStringConstraint type1Constraint = cas.getConstraintFactory().createStringConstraint();
      type1Constraint.equals(lemma);
      ArrayList path = new ArrayList();
      path.add(lemmaFeat.getShortName());
      FSMatchConstraint cons = cas.getConstraintFactory().embedConstraint(path, type1Constraint);
      it = cas.createFilteredIterator(it, cons);

      int count = 0;
      for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
        ++count;
View Full Code Here

Examples of org.apache.uima.cas.FSMatchConstraint

      FSTypeConstraint tc = cf.createTypeConstraint();
      tc.add(sepType);
      tc.add(eosType.getName());
      ArrayList path = new ArrayList();
      path.add(tokenTypeFeat.getShortName());
      FSMatchConstraint cons = cf.embedConstraint(path, tc);
      it = this.cas.createFilteredIterator(it, cons);
      int count = 0;
      for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
        ++count;
      }
View Full Code Here

Examples of org.apache.uima.cas.FSMatchConstraint

   
    FSIntConstraint sentenceEndIntConstraint = cf.createIntConstraint();
    sentenceEndIntConstraint.geq(problemEnd);
   
   
    FSMatchConstraint begin = cf.embedConstraint(sentenceBeginFeaturePath, sentenceBeginIntConstraint);
    FSMatchConstraint end = cf.embedConstraint(sentenceEndFeaturePath, sentenceEndIntConstraint);
   
    FSMatchConstraint beginAndEnd = cf.and(begin, end);
    return beginAndEnd;
  }
View Full Code Here

Examples of org.apache.uima.cas.FSMatchConstraint

   
    FSIntConstraint sentenceEndIntConstraint = cf.createIntConstraint();
    sentenceEndIntConstraint.leq(problemEnd);
   
   
    FSMatchConstraint begin = cf.embedConstraint(sentenceBeginFeaturePath, sentenceBeginIntConstraint);
    FSMatchConstraint end = cf.embedConstraint(sentenceEndFeaturePath, sentenceEndIntConstraint);
   
    FSMatchConstraint beginAndEnd = cf.and(begin, end);
    return beginAndEnd;
  }
View Full Code Here

Examples of org.apache.uima.cas.FSMatchConstraint

   
    Feature sentenceEndFeature = annotationType.getFeatureByBaseName("end");
    FeaturePath sentenceEndFeaturePath = jcas.createFeaturePath();
    sentenceEndFeaturePath.addFeature(sentenceEndFeature);
   
    FSMatchConstraint beginAndEnd = constructConstraintByBeginEnd(
        problemBegin, problemEnd, cf, sentenceBeginFeaturePath,
        sentenceEndFeaturePath);
   
   
    FSTypeConstraint sentenceTypeConstraint = cf.createTypeConstraint();
    sentenceTypeConstraint.add(sentenceType);
   
    FSMatchConstraint beginAndEndAndType = cf.and(beginAndEnd, sentenceTypeConstraint);
   
    FSIterator<Annotation> filteredIterator =
        jcas.createFilteredIterator(jcas.getAnnotationIndex().iterator(),  beginAndEndAndType);
    return filteredIterator;
  }
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.