Package org.apache.uima.collection

Examples of org.apache.uima.collection.CasConsumer


      // 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


        throw new TaeError("Unexpected exception", e);
      }
    }

    try {
      CasConsumer consumer = UIMAFramework.produceCasConsumer(casConsumerDescriptor,
              resourceManager, null);

      return consumer;
    } catch (ResourceInitializationException e) {
View Full Code Here

               .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();

         // check file output
         boolean isIdentical = FileCompare.compare(refFile, testFile);

         if (isIdentical) {
View Full Code Here

        throw new TaeError("Unexpected exception", e);
      }
    }

    try {
      CasConsumer consumer =
              UIMAFramework.produceCasConsumer(casConsumerDescriptor, resourceManager, null);

      return consumer;
    } catch (ResourceInitializationException e) {
View Full Code Here

               .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();

         // check file output
         boolean isIdentical = FileCompare.compare(refFile, testFile);

         if (isIdentical) {
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

               .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();

         // check file output
         boolean isIdentical = FileCompare.compare(refFile, testFile);

         if (isIdentical) {
View Full Code Here

    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

    // 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

    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

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.