Examples of IRutaConstraint


Examples of org.apache.uima.ruta.cde.IRutaConstraint

          return;
        }
        Object element = selection.getFirstElement();
        if (element instanceof ConstraintData) {
          ConstraintData data = (ConstraintData) element;
          IRutaConstraint constraint = data.getConstraint();
          if (constraint instanceof SimpleRutaRuleConstraint) {
            ConstraintDialog cdialog = new ConstraintDialog(getShell());
            cdialog.create((SimpleRutaRuleConstraint) constraint);
            if (cdialog.open() == Window.OK) {
              SimpleRutaRuleConstraint newConstraint = new SimpleRutaRuleConstraint(cdialog
View Full Code Here

Examples of org.apache.uima.ruta.cde.IRutaConstraint

            for (ConstraintData constraintData : constraints) {
              if (monitor.isCanceled()) {
                return Status.CANCEL_STATUS;
              }
              String[] partialResult = new String[2];
              IRutaConstraint constraint = constraintData.getConstraint();
              if (constraint instanceof IRutaRuleConstraint) {
                ((IRutaRuleConstraint) constraint).setTypeSystemLocation(typeSystem
                        .getAbsolutePath());
              }
              // Calculating and adding results to the
              // documentData object
              Double partResult = constraint.processConstraint(inputCAS);
              if (partResult != null) {
                partialResult[0] = constraint.getDescription();
                partialResult[1] = String.valueOf(partResult);
                int weight = constraintData.getWeight();
                count += weight;
                double weightedResult = partResult * weight;
                augResult += weightedResult;
View Full Code Here

Examples of org.apache.uima.ruta.cde.IRutaConstraint

  public void startElement(String uri, String localName, String qName, Attributes attributes) {
    if (localName.equals("constraint")) {
      String type = attributes.getValue("type");
      String weight = attributes.getValue("weight");
      IRutaConstraint c = RutaConstraintFactory.createConstraint(type);
      current = new ConstraintData(c);
      current.setWeight(Integer.valueOf(weight));
    }
  }
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.