Examples of embedConstraint()


Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

    FeaturePath endPath = cas.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);

    FSMatchConstraint annotatioInSpanConstraint = cf.and(embeddedBegin, embeddedEnd);
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

      Feature beginSpanFeature = annotType.getFeatureByBaseName("begin");
      Feature endSpanFeature = annotType.getFeatureByBaseName("end");
     
      FeaturePath beginFeaturePath = jcas.createFeaturePath();
      beginFeaturePath.addFeature(beginSpanFeature);
      FSMatchConstraint beginSpanConstraint = constraintFactory.embedConstraint(beginFeaturePath, windowConstraint);
     
      FeaturePath endFeaturePath = jcas.createFeaturePath();
      endFeaturePath.addFeature(endSpanFeature);
      FSMatchConstraint endSpanConstraint = constraintFactory.embedConstraint(endFeaturePath, windowConstraint);
     
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

      beginFeaturePath.addFeature(beginSpanFeature);
      FSMatchConstraint beginSpanConstraint = constraintFactory.embedConstraint(beginFeaturePath, windowConstraint);
     
      FeaturePath endFeaturePath = jcas.createFeaturePath();
      endFeaturePath.addFeature(endSpanFeature);
      FSMatchConstraint endSpanConstraint = constraintFactory.embedConstraint(endFeaturePath, windowConstraint);
     
      FSMatchConstraint spanConstraint = constraintFactory.and(beginSpanConstraint, endSpanConstraint);
     
      JFSIndexRepository indexes = jcas.getJFSIndexRepository();
      FSIndex<?> annotIndex = indexes.getAnnotationIndex(type);
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

            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));
            }
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

            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);
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

                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));
            }
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

            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.ConstraintFactory.embedConstraint()

            FSMatchConstraint feat_mc = null;
            for (int i = 0; i < values.length; ++i) {
                FSStringConstraint val_sc = cf.createStringConstraint();
                val_sc.equals(values[i].toString());
                if (null == feat_mc) {
                    feat_mc = cf.embedConstraint(feature_path, val_sc);
                }
                else {
                    feat_mc = cf.or(feat_mc, cf.embedConstraint(feature_path, val_sc));
                }
            }
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

                val_sc.equals(values[i].toString());
                if (null == feat_mc) {
                    feat_mc = cf.embedConstraint(feature_path, val_sc);
                }
                else {
                    feat_mc = cf.or(feat_mc, cf.embedConstraint(feature_path, val_sc));
                }
            }
            return feat_mc;
        }
    }
View Full Code Here

Examples of org.apache.uima.cas.ConstraintFactory.embedConstraint()

    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());
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.