Examples of parseAnalysisEngineDescription()


Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    // Test that an aggregate can be copied preserving all comments and ordering of delegates
    XMLParser.ParsingOptions parsingOptions = new XMLParser.ParsingOptions(false);
    parsingOptions.preserveComments = true;
    XMLParser parser = UIMAFramework.getXMLParser();
    File inFile = JUnitExtension.getFile("TextAnalysisEngineImplTest/AggregateWithManyDelegates.xml");
    AnalysisEngineDescription desc = parser.parseAnalysisEngineDescription(new XMLInputSource(inFile), parsingOptions);

    // Write out descriptor
    File cloneFile = new File(inFile.getParentFile(), "CopyOfAggregateWithManyDelegates.xml");
    BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(cloneFile));
    XMLSerializer xmlSerializer = new XMLSerializer(true);
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    TestAnnotator2.allContexts = "";
    UIMAFramework.produceAnalysisEngine(desc);
    assertEquals("D/C/B/A/F/E/", TestAnnotator2.allContexts);
   
    // Check that copying aggregate preserved the order of the delegates
    desc = parser.parseAnalysisEngineDescription(new XMLInputSource(cloneFile), parsingOptions);
    TestAnnotator2.allContexts = "";
    UIMAFramework.produceAnalysisEngine(desc);
    assertEquals("D/C/B/A/F/E/", TestAnnotator2.allContexts);
//    cloneFile.delete();
  }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    // Test that an aggregate can be copied preserving all comments and ordering of delegates
    XMLParser.ParsingOptions parsingOptions = new XMLParser.ParsingOptions(false);
    parsingOptions.preserveComments = true;
    XMLParser parser = UIMAFramework.getXMLParser();
    File inFile = JUnitExtension.getFile("TextAnalysisEngineImplTest/AggregateWithManyDelegates.xml");
    AnalysisEngineDescription desc = parser.parseAnalysisEngineDescription(new XMLInputSource(inFile), parsingOptions);

    // Write out descriptor
    File cloneFile = new File(inFile.getParentFile(), "CopyOfAggregateWithManyDelegates.xml");
    BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(cloneFile));
    XMLSerializer xmlSerializer = new XMLSerializer(true);
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    TestAnnotator2.allContexts = "";
    UIMAFramework.produceAnalysisEngine(desc);
    assertEquals("D/C/B/A/F/E/", TestAnnotator2.allContexts);
   
    // Check that copying aggregate preserved the order of the delegates
    desc = parser.parseAnalysisEngineDescription(new XMLInputSource(cloneFile), parsingOptions);
    TestAnnotator2.allContexts = "";
    UIMAFramework.produceAnalysisEngine(desc);
    assertEquals("D/C/B/A/F/E/", TestAnnotator2.allContexts);
//    cloneFile.delete();
  }
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    // instantiate the aggregate AE
    resMngr.setExtensionClassPath(compClassPath, true);
    String compDescFilePath = insDesc.getMainComponentDesc();
    XMLParser xmlPaser = UIMAFramework.getXMLParser();
    XMLInputSource xmlInput = new XMLInputSource(compDescFilePath);
    AnalysisEngineDescription aeSpec = xmlPaser.parseAnalysisEngineDescription(xmlInput);
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeSpec, resMngr, null);
    Assert.assertTrue(ae != null);
    // create CAS object
    CAS cas = ae.newCAS();
    Assert.assertTrue(cas != null);
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

 
  public static AnalysisEngine createPreprocessingAE(File preprocessDescFile) throws IOException, InvalidXMLException, ResourceInitializationException {
      // create the pre-processing pipeline
        XMLParser parser = UIMAFramework.getXMLParser();
        XMLInputSource source = new XMLInputSource(preprocessDescFile);
        AnalysisEngineDescription desc = parser.parseAnalysisEngineDescription(source);
        return UIMAFramework.produceAnalysisEngine(desc);
  }
 
 
  public static AnalysisEngine createGoldAnnotator(File knowtatorXMLDirectory)
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

   */
  public static AnalysisEngineDescription loadDescription(String pathToDescription) throws IOException, InvalidXMLException {
    File file = new File(pathToDescription);
    XMLParser parser = UIMAFramework.getXMLParser();
    XMLInputSource source = new XMLInputSource(file);
    AnalysisEngineDescription desc = parser.parseAnalysisEngineDescription(source);
    return desc;
  }
 
  private static void writeAggregateDescriptions(
      AggregateBuilder preprocessing,
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

      throws Exception {
    File directory = new File("desc/analysis_engine");
    File file = new File(directory, cls.getSimpleName() + ".xml");
    XMLParser parser = UIMAFramework.getXMLParser();
    XMLInputSource source = new XMLInputSource(file);
    return parser.parseAnalysisEngineDescription(source);
  }

}
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    // create the aggregate description
    AggregateBuilder builder = new AggregateBuilder();
    File preprocessDescFile = new File("desc/analysis_engine/RelationExtractorPreprocessor.xml");
    XMLParser parser = UIMAFramework.getXMLParser();
    XMLInputSource source = new XMLInputSource(preprocessDescFile);
    builder.add(parser.parseAnalysisEngineDescription(source));
    builder.add(modifierExtractorDesc);
    builder.add(degreeOfRelationExtractorDesc);
    builder.add(emPairRelationExtractorDesc);
    AnalysisEngineDescription aggregateDescription = builder.createAggregateDescription();
   
View Full Code Here

Examples of org.apache.uima.util.XMLParser.parseAnalysisEngineDescription()

    // instantiate the aggregate AE
    resMngr.setExtensionClassPath(compClassPath, true);
    String compDescFilePath = insDesc.getMainComponentDesc();
    XMLParser xmlPaser = UIMAFramework.getXMLParser();
    XMLInputSource xmlInput = new XMLInputSource(compDescFilePath);
    AnalysisEngineDescription aeSpec = xmlPaser.parseAnalysisEngineDescription(xmlInput);
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeSpec, resMngr, null);
    Assert.assertTrue(ae != null);
    // create CAS object
    CAS cas = ae.newCAS();
    Assert.assertTrue(cas != null);
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.