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

      AggregateBuilder builder = new AggregateBuilder();
      File directoryCtakes = new File("../ctakes-core/desc/analysis_engine");
      File fileCtakes = new File(directoryCtakes, "TokenizerAnnotator.xml");
      XMLParser parser = UIMAFramework.getXMLParser();
      XMLInputSource source = new XMLInputSource(fileCtakes);
      builder.add(parser.parseAnalysisEngineDescription(source));
      File directory = new File("desc/analysis_engine");
      File file = new File(directory, "SentenceDetectorAnnotator.xml");
      source = new XMLInputSource(file);
      builder.add(parser.parseAnalysisEngineDescription(source));
      AnalysisEngine engine = builder.createAggregate();
View Full Code Here

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

      XMLInputSource source = new XMLInputSource(fileCtakes);
      builder.add(parser.parseAnalysisEngineDescription(source));
      File directory = new File("desc/analysis_engine");
      File file = new File(directory, "SentenceDetectorAnnotator.xml");
      source = new XMLInputSource(file);
      builder.add(parser.parseAnalysisEngineDescription(source));
      AnalysisEngine engine = builder.createAggregate();
      JCas jCas = engine.newJCas();
      jCas.setDocumentText(text);
      Segment s = new Segment(jCas);
      s.setBegin(0);
View Full Code Here

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

  private void addDescriptor(AggregateBuilder builder, String path)
      throws IOException, InvalidXMLException {
    File fileCtakes = new File(path);
    XMLParser parser = UIMAFramework.getXMLParser();
    XMLInputSource source = new XMLInputSource(fileCtakes);
    builder.add(parser.parseAnalysisEngineDescription(source));
  }
}
View Full Code Here

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

  public static void addDescriptor(AggregateBuilder builder, String path)
      throws IOException, InvalidXMLException {
    File fileCtakes = new File(path);
    XMLParser parser = UIMAFramework.getXMLParser();
    XMLInputSource source = new XMLInputSource(fileCtakes);
    builder.add(parser.parseAnalysisEngineDescription(source));
  }

  /**
   * Create a simple aggregate ae that does sentence splitting, tokenization,
   * and stores results in database. runs the following AEs: <li>
View Full Code Here

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

      AggregateBuilder builder = new AggregateBuilder();
      builder.add(UriToDocumentTextAnnotator.getDescription());
      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(AnalysisEngineFactory.createPrimitiveDescription(
          ViewCreatorAnnotator.class,
          ViewCreatorAnnotator.PARAM_VIEW_NAME,
          GOLD_VIEW_NAME));
      builder.add(AnalysisEngineFactory.createPrimitiveDescription(CopyDocumentTextToGoldView.class));
View Full Code Here

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

    // create annotation tester with the regex annotator specifier
    File descFile = JUnitExtension.getFile("wildcardFilenameSyntax/loadFilesWithWildcard.xml");
    File dpDir = descFile.getParentFile().getParentFile();
    String datapath = dpDir.getAbsolutePath();
    XMLParser parser = UIMAFramework.getXMLParser();
    AnalysisEngineDescription desc = parser.parseAnalysisEngineDescription(new XMLInputSource(
        descFile));
    ResourceManager rm = UIMAFramework.newDefaultResourceManager();
    rm.setDataPath(datapath);
    AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(desc, rm, null);
    CAS cas = ae.newCAS();
View Full Code Here

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

public class ConvertXMIAssertionsToi2b2Format {

  private static CAS getTypeSystemFromDescriptor(String descriptor) throws InvalidXMLException, IOException, ResourceInitializationException, CASException {
    XMLParser xmlParser = UIMAFramework.getXMLParser();
    AnalysisEngineDescription tsDesc = xmlParser.parseAnalysisEngineDescription(new XMLInputSource(descriptor));
    return CasCreationUtils.createCas(tsDesc);
  }
 
 
  public static void main(String [] args) throws IOException, InvalidXMLException, CASException {
View Full Code Here

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

public class Converti2b2AnnotationsToCTAKES {
  private static Logger logger = Logger.getLogger(Converti2b2AnnotationsToCTAKES.class);
 
  private static CAS getTypeSystemFromDescriptor(String descriptor) throws InvalidXMLException, IOException, ResourceInitializationException, CASException {
    XMLParser xmlParser = UIMAFramework.getXMLParser();
    AnalysisEngineDescription tsDesc = xmlParser.parseAnalysisEngineDescription(new XMLInputSource(descriptor));
    return CasCreationUtils.createCas(tsDesc);
  }
 
  /**
     * Serialize a CAS to a file in XMI format
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.