Success!!! That solved it.

I had only tried to pass ts to the CollectionReader, but it is necessary to 
pass it to all components.

Thanks a lot!

Cheers,

/rp


> On 20 Apr 2016, at 07:23, Richard Eckart de Castilho <[email protected]> wrote:
> 
> Hi,
> 
> you can load the type system first:
> 
>       TypeSystemDescription ts = 
> TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("http://svn.apache.org/repos/asf/opennlp/tags/opennlp-1.6.0-rc6/opennlp-uima/descriptors/TypeSystem.xml";);
> 
> Then pass "ts" as the second argument to all the create* calls, just after 
> the class name, e.g.:
> 
> CollectionReaderDescription reader = CollectionReaderFactory
>                               
> .createReaderDescription(AbstractCollectionReader.class, ts, 
> AbstractCollectionReader.PARAM_VALUE, 33);
> 
> Cheers,
> 
> -- Richard
> 
>> On 19.04.2016, at 23:13, Rui Lopes <[email protected]> wrote:
>> 
>> The issue is that I would like to use a CollectionReader instead of creating 
>> the document. Something like this:
>> 
>>      private static void mine() throws UIMAException, IOException {
>> 
>>              CollectionReaderDescription reader = CollectionReaderFactory
>>                              
>> .createReaderDescription(AbstractCollectionReader.class, 
>> AbstractCollectionReader.PARAM_VALUE, 33);
>> 
>>              AnalysisEngineDescription tokenizer = 
>> AnalysisEngineFactory.createEngineDescription(SimpleTokenizer.class,
>>                              UimaUtil.TOKEN_TYPE_PARAMETER, 
>> "pt.ipb.pos.type.Token", UimaUtil.SENTENCE_TYPE_PARAMETER,
>>                              "pt.ipb.pos.type.Sentence");
>> 
>>              // AnalysisEngineDescription histogramer = 
>> AnalysisEngineFactory.createEngineDescription(HistogramAnnotator.class);
>> 
>>              AnalysisEngineDescription ae = 
>> AnalysisEngineFactory.createEngineDescription(GetStartedQuickAE.class);
>> 
>>              SimplePipeline.runPipeline(reader, tokenizer, ae);
>> 
>>      }
>> 
>> 
>> Should I initialise the type system to the OpenNLP one? How can I do that?
>> 
>> It is possible to use a custom type system as in the code above 
>> (“pt.ipb.pos.type.Token”)? How?
>> 
>> Sorry about this probably naive questions, but I confess I must be missing 
>> something basic…
>> 
>> Cheers,
>> 
>> /rp
> 

Reply via email to