Examples of FSIntConstraint


Examples of org.apache.uima.cas.FSIntConstraint

        {
            FeaturePath begin_fp = m_feat2path.get("begin");             
            FeaturePath end_fp = m_feat2path.get("end");             

            ConstraintFactory cf = jcas.getConstraintFactory();
            FSIntConstraint bcLower = cf.createIntConstraint();
            bcLower.geq(begin_lower);
            FSMatchConstraint mcBegin = cf.embedConstraint(begin_fp, bcLower);
            if (begin_upper > begin_lower) {
                FSIntConstraint bcUpper = cf.createIntConstraint();
                bcUpper.lt(begin_upper);
                mcBegin = cf.and(mcBegin, cf.embedConstraint(begin_fp, bcUpper));
            }

            FSIntConstraint ecUpper = cf.createIntConstraint();
            ecUpper.leq(end_upper);        
            FSMatchConstraint mcEnd = cf.embedConstraint(end_fp, ecUpper);
            if (end_upper > end_lower) {
                FSIntConstraint ecLower = cf.createIntConstraint();
                ecLower.gt(end_lower);
                mcEnd = cf.and(mcEnd, cf.embedConstraint(end_fp, ecLower));
            }
           
            FSMatchConstraint mcBounds = cf.and(mcBegin, mcEnd);
            return mcBounds;
View Full Code Here

Examples of org.apache.uima.cas.FSIntConstraint

    if (windowAnnotation == null)
      return null;
    FeaturePath beginFP = cas.createFeaturePath();
    Type type = windowAnnotation.getType();
    beginFP.addFeature(type.getFeatureByBaseName("begin"));
    FSIntConstraint intConstraint = cf.createIntConstraint();
    intConstraint.geq(windowAnnotation.getBegin());
    FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);

    FeaturePath endFP = cas.createFeaturePath();
    endFP.addFeature(type.getFeatureByBaseName("end"));
    intConstraint = cf.createIntConstraint();
    intConstraint.leq(windowAnnotation.getEnd());
    FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);

    FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);
    return windowConstraint;
  }
View Full Code Here

Examples of org.apache.uima.cas.FSIntConstraint

    Type annotationType = getCAS().getAnnotationType();

    FeaturePath beginPath = getCAS().createFeaturePath();
    beginPath.addFeature(annotationType.getFeatureByBaseName("begin"));
    FSIntConstraint beginConstraint = cf.createIntConstraint();
    beginConstraint.geq(span.getStart());

    FSMatchConstraint embeddedBegin = cf.embedConstraint(beginPath, beginConstraint);

    FeaturePath endPath = getCAS().createFeaturePath();
    endPath.addFeature(annotationType.getFeatureByBaseName("end"));
    FSIntConstraint endConstraint = cf.createIntConstraint();
    endConstraint.leq(span.getEnd());

    FSMatchConstraint embeddedEnd = cf.embedConstraint(endPath, endConstraint);

    FSMatchConstraint strictType = new StrictTypeConstraint(type);
View Full Code Here

Examples of org.apache.uima.cas.FSIntConstraint

    if (windowAnnotation == null)
      return null;
    FeaturePath beginFP = cas.createFeaturePath();
    Type type = windowAnnotation.getType();
    beginFP.addFeature(type.getFeatureByBaseName("begin"));
    FSIntConstraint intConstraint = cf.createIntConstraint();
    intConstraint.geq(windowAnnotation.getBegin());
    FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);

    FeaturePath endFP = cas.createFeaturePath();
    endFP.addFeature(type.getFeatureByBaseName("end"));
    intConstraint = cf.createIntConstraint();
    intConstraint.leq(windowAnnotation.getEnd());
    FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);

    FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);
    return windowConstraint;
  }
View Full Code Here

Examples of org.apache.uima.cas.FSIntConstraint

   */
  public FSMatchConstraint constructContainedByConstraint(int problemBegin,
      int problemEnd, ConstraintFactory cf,
      FeaturePath sentenceBeginFeaturePath, FeaturePath sentenceEndFeaturePath)
  {
    FSIntConstraint sentenceBeginIntConstraint = cf.createIntConstraint();
    sentenceBeginIntConstraint.leq(problemBegin);
   
    FSIntConstraint sentenceEndIntConstraint = cf.createIntConstraint();
    sentenceEndIntConstraint.geq(problemEnd);
   
   
    FSMatchConstraint begin = cf.embedConstraint(sentenceBeginFeaturePath, sentenceBeginIntConstraint);
    FSMatchConstraint end = cf.embedConstraint(sentenceEndFeaturePath, sentenceEndIntConstraint);
   
View Full Code Here

Examples of org.apache.uima.cas.FSIntConstraint

   */
  public FSMatchConstraint constructContainedByConstraint(int problemBegin,
      int problemEnd, ConstraintFactory cf,
      FeaturePath sentenceBeginFeaturePath, FeaturePath sentenceEndFeaturePath)
  {
    FSIntConstraint sentenceBeginIntConstraint = cf.createIntConstraint();
    sentenceBeginIntConstraint.geq(problemBegin);
   
    FSIntConstraint sentenceEndIntConstraint = cf.createIntConstraint();
    sentenceEndIntConstraint.leq(problemEnd);
   
   
    FSMatchConstraint begin = cf.embedConstraint(sentenceBeginFeaturePath, sentenceBeginIntConstraint);
    FSMatchConstraint end = cf.embedConstraint(sentenceEndFeaturePath, sentenceEndIntConstraint);
   
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.