Package org.apache.uima.collection

Examples of org.apache.uima.collection.CollectionReaderDescription


      uimaEEEngine = new BaseUIMAAsynchronousEngine_impl();
    }

    // add Collection Reader if specified
    if (collectionReaderDescriptor != null) {
      CollectionReaderDescription collectionReaderDescription = UIMAFramework.getXMLParser()
              .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));

      CollectionReader collectionReader = UIMAFramework
              .produceCollectionReader(collectionReaderDescription);
View Full Code Here


  protected void setUp() throws Exception {
    ccFactory = new CollectionReaderFactory_impl();
  }

  public void testInvalidFrameworkImplementation() {
    CollectionReaderDescription desc = new CollectionReaderDescription_impl();
    desc.setFrameworkImplementation("foo");   
    try {
      ccFactory.produceResource(CollectionReader.class, desc, Collections.EMPTY_MAP);
      fail();
    } catch (ResourceInitializationException e) {
      assertNotNull(e.getMessage());
View Full Code Here

  public void runProcessingThread(File inputDir, String inputFileFormat, Boolean lenient, File outputDir, File aeSpecifierFile,
          String xmlTag, String language, String encoding) {
    try {
      // create and configure collection reader that will read input docs
      CollectionReaderDescription collectionReaderDesc = FileSystemCollectionReader
              .getDescription();
      ConfigurationParameterSettings paramSettings = collectionReaderDesc.getMetaData()
              .getConfigurationParameterSettings();
      paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR, inputDir
              .getAbsolutePath());
      paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_XCAS, inputFileFormat);
      paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_LENIENT, lenient ? "true" : "false");
View Full Code Here

    AbstractSection.setVnsHostAndPort(aAe);
    // copy Ae into real descriptors if needed
    getTrueDescriptor();
    // use clones because validation modifies (imports get imported)
    if (isCollectionReaderDescriptor()) {
      CollectionReaderDescription collRdr = (CollectionReaderDescription) collectionReaderDescription
              .clone();
      try {
        collRdr.doFullValidation(createResourceManager());
      } catch (Throwable e) { // all these are Throwable to catch errors like
        // UnsupportedClassVersionError, which happens if the annotator
        // class is compiled for Java 5.0, but the CDE is running Java 1.4.2
        Utility
                .popMessage(
View Full Code Here

          "collection_reader"+ System.getProperty("file.separator") +
          "FileSystemCollectionReader.xml";
          
         // add Collection Reader if specified
         try {
             CollectionReaderDescription collectionReaderDescription =
                     UIMAFramework.getXMLParser()
                             .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));
             collectionReaderDescription.getCollectionReaderMetaData().
               getConfigurationParameterSettings().
                 setParameterValue("InputDirectory", relativeDataPath);
             CollectionReader collectionReader = UIMAFramework
                     .produceCollectionReader(collectionReaderDescription);
             uimaAsEngine.setCollectionReader(collectionReader);     
View Full Code Here

    if (filename == null) {
      fail("Unable to find file:" + "descriptors/collection_reader/ExtendedTestFileSystemCollectionReader.xml"
              + "in classloader");
    }
    File collectionReaderDescriptor = new File(filename);
    CollectionReaderDescription collectionReaderDescription = UIMAFramework.getXMLParser()
            .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));
    CollectionReader collectionReader = UIMAFramework
            .produceCollectionReader(collectionReaderDescription);
    eeUimaEngine.setCollectionReader(collectionReader);
    initialize(eeUimaEngine, appCtx);
View Full Code Here

  }

  @Test
  public void testResourceMetaData() throws Exception
  {
    CollectionReaderDescription desc = CollectionReaderFactory
            .createReaderDescription(TestCR.class);
   
    org.apache.uima.resource.metadata.ResourceMetaData meta = desc.getMetaData();
   
    assertEquals("dummy", meta.getName());
    assertEquals("1.0", meta.getVersion());
    assertEquals("Just a dummy", meta.getDescription());
    assertEquals("ASL 2.0", meta.getCopyright());
View Full Code Here

   */
  @Test
  public void demoAggregateWithReader() throws UIMAException {
    ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();

    CollectionReaderDescription reader = factory.createCollectionReaderDescription();
    reader.getMetaData().setName("reader");
    reader.setImplementationName(SimpleReader.class.getName());

    AnalysisEngineDescription analyzer = factory.createAnalysisEngineDescription();
    analyzer.getMetaData().setName("analyzer");
    analyzer.setPrimitive(true);
    analyzer.setImplementationName(SimpleAnalyzer.class.getName());
View Full Code Here

   */
  public static void main(String[] args) {
    options.parseOptions(args);

    TypeSystemDescription typeSystemDescription;
    CollectionReaderDescription collectionReader = null;
    AnalysisEngineDescription userInput = null;
   
    try {
      typeSystemDescription = TypeSystemDescriptionFactory.createTypeSystemDescription();
     
View Full Code Here

          // (found in ctakes-type-system/src/main/resources)
        TypeSystemDescriptionFactory.createTypeSystemDescription();
     
      AggregateBuilder aggregate = new AggregateBuilder();
     
      CollectionReaderDescription collectionReader = CollectionReaderFactory.createDescription(
          FilesInDirectoryCollectionReader.class,
          typeSystemDescription,
          "InputDirectory",
          textDirectory.toString()
          );
View Full Code Here

TOP

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

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.