Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.ResultSpecification.addResultType()


      //we can't test from the threads themsleves since the state of
      //these fields is nondeterministic during the multithreaded processing.
      assertEquals("testing...", TestAnnotator.getLastDocument());
      ResultSpecification lastResultSpec = TestAnnotator.getLastResultSpec();
      ResultSpecification resultSpec = new ResultSpecification_impl(lastResultSpec.getTypeSystem());
      resultSpec.addResultType("NamedEntity", true);
      assertEquals(resultSpec, lastResultSpec);

    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here


    assertEquals("new test", TestAnnotator.lastDocument);
    tcas.reset();

    // process(CAS,ResultSpecification)
    ResultSpecification resultSpec = new ResultSpecification_impl(tcas.getTypeSystem());
    resultSpec.addResultType("NamedEntity", true);

    tcas.setDocumentText("testing...");
    tae.process(tcas, resultSpec);
    assertEquals("testing...", TestAnnotator.lastDocument);
    assertEquals(resultSpec, TestAnnotator.lastResultSpec);
View Full Code Here

            languagesToAdd.add(language);
          }
        }
        if (0 < languagesToAdd.size()) {
          if (tof.isType()) {
            newResultSpec.addResultType(tofName, tof.isAllAnnotatorFeatures(),
                languagesToAdd.toArray(EMPTY_STRING_ARRAY));
          } else {
            newResultSpec.addResultFeature(tofName, languagesToAdd.toArray(EMPTY_STRING_ARRAY));
         
        }
View Full Code Here

        mAE.process(tcas);
        tcas.reset();

        // process(CAS,ResultSpecification)
        ResultSpecification resultSpec = new ResultSpecification_impl(tcas.getTypeSystem());
        resultSpec.addResultType("NamedEntity", true);

        tcas.setDocumentText("testing...");
        mAE.process(tcas, resultSpec);
        tcas.reset();
View Full Code Here

        for (int i = 2; i < args.length; i++) {
          if (args[i].indexOf(':') > 0) // feature name
          {
            resultSpec.addResultFeature(args[i]);
          } else {
            resultSpec.addResultType(args[i], false);
          }
        }
      }

      // read contents of file
View Full Code Here

      if (ae != null) {

        ResultSpecification rs = ae.createResultSpecification();
        for (int i = 0; i < resultSpecTypes.length; ++i) {
          // allAnnotatorFeatures is not considere here! (TODO)
          rs
                  .addResultType(casImpl.getTypeSystemImpl().getType(resultSpecTypes[i]).getName(),
                          false);
        }
        for (int i = 0; i < resultSpecFeatures.length; ++i) {
          rs.addResultFeature(casImpl.getTypeSystemImpl().getFeature(resultSpecFeatures[i])
View Full Code Here

      }
      for (int j = 0; j < outputs.length; j++) {
        for (int k = 0; k < languages.length; k++) {
          if (outputs[j].isType()
                  && inputResultSpec.containsType(outputs[j].getName(), languages[k])) {
            newResultSpec.addResultType(outputs[j].getName(), outputs[j].isAllAnnotatorFeatures(),
                    new String[] { languages[k] });
          } else if (!outputs[j].isType()
                  && inputResultSpec.containsFeature(outputs[j].getName(), languages[k])) {
            newResultSpec.addResultFeature(outputs[j].getName(), new String[] { languages[k] });
          }
View Full Code Here

      //Check TestAnnotator fields only at the very end of processing,
      //we can't test from the threads themsleves since the state of
      //these fields is nondeterministic during the multithreaded processing.
      assertEquals("testing...", TestAnnotator.getLastDocument());
      ResultSpecification resultSpec = new ResultSpecification_impl();
      resultSpec.addResultType("NamedEntity", true);
      assertEquals(resultSpec, TestAnnotator.getLastResultSpec());

    } catch (Exception e) {
      JUnitExtension.handleException(e);
    }
View Full Code Here

    assertEquals("new test", TestAnnotator.lastDocument);
    tcas.reset();

    // process(CAS,ResultSpecification)
    ResultSpecification resultSpec = new ResultSpecification_impl();
    resultSpec.addResultType("NamedEntity", true);

    tcas.setDocumentText("testing...");
    tae.process(tcas, resultSpec);
    assertEquals("testing...", TestAnnotator.lastDocument);
    assertEquals(resultSpec, TestAnnotator.lastResultSpec);
View Full Code Here

        mAE.process(tcas);
        tcas.reset();

        // process(CAS,ResultSpecification)
        ResultSpecification resultSpec = new ResultSpecification_impl();
        resultSpec.addResultType("NamedEntity", true);

        tcas.setDocumentText("testing...");
        mAE.process(tcas, resultSpec);
        tcas.reset();
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.