Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.AnalysisEngine.reconfigure()


    String inputViewName = "inview";

    ae.setConfigParameterValue(HtmlConverter.INPUT_VIEW, inputViewName);
    ae.setConfigParameterValue(HtmlConverter.OUTPUT_VIEW, outputViewName);
    ae.reconfigure();
    cas.reset();
    CAS inview = cas.createView(inputViewName);
    inview.setDocumentText(htmlUnix);

    // go:
View Full Code Here


    t1 = cas.getTypeSystem().getType(TEST_TYPE);
    assertEquals(1, cas.getAnnotationIndex(t1).size());
   
    // create a new cas and force the ae to update its types
    ae.setConfigParameterValue(RutaEngine.PARAM_RELOAD_SCRIPT, true);
    ae.reconfigure();
   
    final CAS cas2 = CasCreationUtils.createCas(metaData);
    cas2.setDocumentText(input);
    SimplePipeline.runPipeline(cas2, ae);
View Full Code Here

    t1 = cas2.getTypeSystem().getType(TEST_TYPE);
    assertEquals(1, cas2.getAnnotationIndex(t1).size());
   
    // create a new cas and do not force the ae to update its types
    ae.setConfigParameterValue(RutaEngine.PARAM_RELOAD_SCRIPT, false);
    ae.reconfigure();
    final CAS cas3 = CasCreationUtils.createCas(metaData);
    cas3.setDocumentText(input);
    SimplePipeline.runPipeline(cas3, ae);

    t1 = cas3.getTypeSystem().getType(TEST_TYPE);
View Full Code Here

    Type tagType = cas.getTypeSystem().getType(HtmlAnnotator.NAMESPACE + "TAG");
    AnnotationIndex<AnnotationFS> ai = null;
    FSIterator<AnnotationFS> iterator = null;

    ae.setConfigParameterValue("onlyContent", false);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(html);
    ae.process(cas);
    ai = cas.getAnnotationIndex(tagType);
    iterator = ai.iterator();
View Full Code Here

    assertEquals(91, a.getBegin());
    assertEquals(96, a.getEnd());

   
    ae.setConfigParameterValue("onlyContent", true);
    ae.reconfigure();
    cas.reset();
    cas.setDocumentText(html);
    ae.process(cas);
    ai = cas.getAnnotationIndex(tagType);
    iterator = ai.iterator();
View Full Code Here

    aed.getAnalysisEngineMetaData().setTypeSystem(mergeTypeSystems);
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aed);
    ae.setConfigParameterValue(RutaModifier.OUTPUT_LOCATION, "");
    String viewName = "modified_for_testing";
    ae.setConfigParameterValue(RutaModifier.OUTPUT_VIEW, viewName);
    ae.reconfigure();
   
    String scriptName = this.getClass().getSimpleName();
    CAS cas = null;
    try {
      cas = RutaTestUtils.process(namespace + "/" + scriptName + RutaEngine.SCRIPT_FILE_EXTENSION, namespace + "/test.html", 50);
View Full Code Here

    if (resourceFile != null) {
      ae.setConfigParameterValue(RutaEngine.PARAM_RESOURCE_PATHS, new String[]{resourceFile.getPath()});
    }

    ae.reconfigure();
    if (cas == null) {
      cas = ae.newCAS();
      cas.setDocumentText(FileUtils.file2String(textFile, "UTF-8"));
    }
    ae.process(cas);
View Full Code Here

        }
      }
    }

    try {
      targetEngine.reconfigure();
    } catch (ResourceConfigurationException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

          languageExtensions.add(each.getClass().getName());
        }
        ae.setConfigParameterValue(RutaEngine.PARAM_ADDITIONAL_EXTENSIONS,
                languageExtensions.toArray(new String[0]));

        ae.reconfigure();
        CAS cas = ae.newCAS();

        monitor.worked(1);

        if (monitor.isCanceled()) {
View Full Code Here

    if (parameters != null) {
      for (Map.Entry<String, Object> parameter : parameters.entrySet()) {
        ae.setConfigParameterValue(parameter.getKey(), parameter.getValue());
      }
    }
    ae.reconfigure();
    ae.process(cas);
    scriptFile.delete();
    ae.destroy();
  }
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.