Package org.apache.uima.collection

Examples of org.apache.uima.collection.CasConsumer


    try
    {
        xmlIn = new XMLInputSource(this.pkgBrowser.getInstallationDescriptor().getMainComponentDesc());
        ResourceSpecifier ccSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(xmlIn);

        CasConsumer cc = UIMAFramework.produceCasConsumer(ccSpecifier,
                getResourceManager(this.pkgBrowser), null);
        // create Test status object
        TestStatus status = new TestStatus();
   
        if (cc != null) {
View Full Code Here


      // create a UimaContext with Config Params and Resources
      UIMAFramework.getXMLParser().enableSchemaValidation(true);
      CasConsumerDescription ccDesc = UIMAFramework.getXMLParser().parseCasConsumerDescription(
              new XMLInputSource(JUnitExtension
                      .getFile("UimaContextTest/CasConsumerForUimaContextTest.xml")));
      CasConsumer cc = UIMAFramework.produceCasConsumer(ccDesc, rm, null);
      mContext = cc.getUimaContext();

      // create a UimaContext with Config Params in Groups but no resources
      XMLInputSource in = new XMLInputSource(JUnitExtension
              .getFile("AnnotatorContextTest/AnnotatorWithConfigurationGroups.xml"));
      AnalysisEngineDescription taeDesc = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(in);
View Full Code Here

    // CAS Consumer
    System.out.println("Initializing CAS Consumer");
    ResourceSpecifier consumerSpecifier = UIMAFramework.getXMLParser().parseCasConsumerDescription(
            new XMLInputSource(args[2]));
    CasConsumer casConsumer = UIMAFramework.produceCasConsumer(consumerSpecifier);

    // create a new Collection Processing Manager
    mCPM = UIMAFramework.newCollectionProcessingManager();

    // Register AE and CAS Consumer with the CPM
View Full Code Here

      System.out.println("XCAS deserialized");

      ae.process(cas);
      CasConsumerDescription casConsumerDescription = UIMAFramework.getXMLParser().parseCasConsumerDescription(
        new XMLInputSource(new File(casConsumerDescriptorLocation)));
      CasConsumer casConsumer = UIMAFramework.produceCasConsumer(casConsumerDescription);
      System.out.println("CasConsumer initialized.  Calling processCas....");
      casConsumer.processCas(cas);
      System.out.println("processCas completed....");
  }
  catch(Exception e)
  {
      e.printStackTrace();
View Full Code Here

  public static boolean testCasConsumer(File ccSpecifierFile) throws IOException,
          InvalidXMLException, ResourceInitializationException {
    try {
      XMLInputSource xmlIn = new XMLInputSource(ccSpecifierFile);
      ResourceSpecifier ccSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(xmlIn);
      CasConsumer cc = UIMAFramework.produceCasConsumer(ccSpecifier);
      return cc != null;
    } catch (IOException ioE) {
      System.err
              .println("Error on creating XML source from descriptor file :: " + ioE.getMessage());
      throw ioE;
View Full Code Here

      // Create an XML input source from the specifier file.
      XMLInputSource in = new XMLInputSource(JUnitExtension.getURL("AnnotationWriter.xml"));
      // Parse the specifier.
      ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);

      CasConsumer consumer = UIMAFramework.produceCasConsumer(specifier);

      consumer.setConfigParameterValue("AnnotationTypes", AnnotationTypes);

      consumer.setConfigParameterValue("outputFile", testFile.getAbsolutePath());

      consumer.reconfigure();

      consumer.processCas(cas);
      consumer.destroy();

      boolean isIdentic = FileCompare.compare(refFile, testFile);
      // check fileoutput

      if (isIdentic) {
View Full Code Here

      // create a UimaContext with Config Params and Resources
      UIMAFramework.getXMLParser().enableSchemaValidation(true);
      CasConsumerDescription ccDesc = UIMAFramework.getXMLParser().parseCasConsumerDescription(
              new XMLInputSource(JUnitExtension
                      .getFile("UimaContextTest/CasConsumerForUimaContextTest.xml")));
      CasConsumer cc = UIMAFramework.produceCasConsumer(ccDesc, rm, null);
      mContext = cc.getUimaContext();

      // create a UimaContext with Config Params in Groups but no resources
      XMLInputSource in = new XMLInputSource(JUnitExtension
              .getFile("AnnotatorContextTest/AnnotatorWithConfigurationGroups.xml"));
      AnalysisEngineDescription taeDesc = UIMAFramework.getXMLParser().parseTaeDescription(in);
View Full Code Here

      // create a UimaContext with Config Params and Resources
      UIMAFramework.getXMLParser().enableSchemaValidation(true);
      CasConsumerDescription ccDesc = UIMAFramework.getXMLParser().parseCasConsumerDescription(
              new XMLInputSource(JUnitExtension
                      .getFile("UimaContextTest/CasConsumerForUimaContextTest.xml")));
      CasConsumer cc = UIMAFramework.produceCasConsumer(ccDesc, rm, null);
      mContext = cc.getUimaContext();

      // create a UimaContext with Config Params in Groups but no resources
      XMLInputSource in = new XMLInputSource(JUnitExtension
              .getFile("AnnotatorContextTest/AnnotatorWithConfigurationGroups.xml"));
      AnalysisEngineDescription taeDesc = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(in);
View Full Code Here

    setSystemProperties(this.pkgBrowser);

    XMLInputSource xmlIn = new XMLInputSource(this.pkgBrowser.getInstallationDescriptor()
            .getMainComponentDesc());
    ResourceSpecifier ccSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(xmlIn);
    CasConsumer cc = UIMAFramework.produceCasConsumer(ccSpecifier,
            getResourceManager(this.pkgBrowser), null);
    // create Test status object
    TestStatus status = new TestStatus();

    if (cc != null) {
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.CasConsumer

Copyright © 2018 www.massapicom. 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.