Examples of eval()


Examples of opennlp.model.AbstractModel.eval()

        new File(args[0])).getModel();
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    DecimalFormat df = new java.text.DecimalFormat(".###");
    for (String line = in.readLine(); line != null; line = in.readLine()) {
      String[] context = line.split(" ");
      double[] dist = m.eval(context);
      for (int oi = 0; oi < dist.length; oi++) {
        System.out.print("[" + m.getOutcome(oi) + " " + df.format(dist[oi])
            + "] ");
      }
      System.out.println();
View Full Code Here

Examples of opennlp.model.MaxentModel.eval()

    MaxentModel smallModel = GIS.trainModel(100,
        new OnePassRealValueDataIndexer(smallEventStream, 0), false);
    String[] contexts = smallTest.split(" ");
    float[] values = RealValueFileEventStream.parseContexts(contexts);
    double[] smallResults = smallModel.eval(contexts, values);

    String smallResultString = smallModel.getAllOutcomes(smallResults);
    System.out.println("smallResults: " + smallResultString);

    StringReader largeReader = new StringReader(largeValues);
View Full Code Here

Examples of opennlp.tools.ml.model.AbstractModel.eval()

    }
    ObjectStream<Event> es = new ParserEventStream(new ParseSampleStream(new PlainTextByLineStream(new java.io.InputStreamReader(System.in))), rules, etype, dict);
    Event e;
    while ((e = es.read()) != null) {
      if (model != null) {
        System.out.print(model.eval(e.getContext())[model.getIndex(e.getOutcome())]+" ");
      }
      System.out.println(e);
    }
  }
}
View Full Code Here

Examples of opennlp.tools.ml.model.MaxentModel.eval()

    if (modelPackage.getPosModel() != null) {

      MaxentModel posModel = modelPackage.getPosModel();

      double[] probs = posModel.eval(contextGen.getContext(index,
          words.toArray(new String[words.size()]),
          tags.toArray(new String[tags.size()]),null));

      String[] orderedTags = new String[probs.length];
      for (int i = 0; i < probs.length; i++) {
View Full Code Here

Examples of org.apache.batik.ext.awt.geom.Cubic.eval()

                        float min = 0;
                        float max = 1;
                        Point2D.Double p;
                        for (;;) {
                            float t = (min + max) / 2;
                            p = c.eval(t);
                            double x = p.getX();
                            if (Math.abs(x - interpolation) < tolerance) {
                                break;
                            }
                            if (x < interpolation) {
View Full Code Here

Examples of org.apache.bsf.BSFEngine.eval()

    protected Object evalFileOrScript(BSFManager mgr) throws BSFException{
        BSFEngine bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());
        final String scriptFile = getFilename();
        if (scriptFile.length() == 0) {
            return bsfEngine.eval("[script]",0,0,getScript());
        } else {// we have a file, read and process it
            try {
                String script=FileUtils.readFileToString(new File(scriptFile));
                return bsfEngine.eval(scriptFile,0,0,script);
            } catch (IOException e) {
View Full Code Here

Examples of org.apache.bsf.BSFManager.eval()

    {
      final BSFManager interpreter = new BSFManager();
      interpreter.declareBean("chart", originalChart, JFreeChart.class); //$NON-NLS-1$
      interpreter.declareBean("runtime", runtimeWrapper, ExpressionRuntime.class); //$NON-NLS-1$
      interpreter.declareBean("dataRow", legacyDataRowWrapper, DataRow.class); //$NON-NLS-1$
      final Object o = interpreter.eval
          (postProcessingLanguage, "expression", 1, 1, postProcessingScript); //$NON-NLS-1$
      if (o instanceof JFreeChart)
      {
        return (JFreeChart) o;
      }
View Full Code Here

Examples of org.apache.commons.scxml.Evaluator.eval()

                if (src == null) {
                    String srcexpr = i.getSrcexpr();
                    Object srcObj = null;
                    try {
                        ctx.setLocal(NAMESPACES_KEY, i.getNamespaces());
                        srcObj = eval.eval(ctx, srcexpr);
                        ctx.setLocal(NAMESPACES_KEY, null);
                        src = String.valueOf(srcObj);
                    } catch (SCXMLExpressionException see) {
                        errRep.onError(ErrorConstants.EXPRESSION_ERROR,
                            see.getMessage(), i);
View Full Code Here

Examples of org.apache.commons.scxml2.Evaluator.eval()

                wait = parseDelay(delayString, exctx.getAppLog());
            }
        }
        String eventValue = event;
        if (event != null) {
            eventValue = (String) eval.eval(ctx, event);
            if ((eventValue == null || eventValue.trim().length() == 0) && exctx.getAppLog().isWarnEnabled()) {
                exctx.getAppLog().warn("<send>: event expression \"" + event
                    + "\" evaluated to null or empty String");
            }
        }
View Full Code Here

Examples of org.apache.drill.exec.ref.eval.EvaluatorTypes.BasicEvaluator.eval()

    LogicalExpression e = parser.parse().e;
    RecordPointer r = new UnbackedRecord();
    r.addField(new SchemaPath("a", ExpressionPosition.UNKNOWN), new IntegerScalar(3));
    SimpleEvaluationVisitor builder = new SimpleEvaluationVisitor(r);
    BasicEvaluator eval = e.accept(builder, null);
    DataValue v = eval.eval();
    System.out.println(v);
  }
 
}
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.