On 23.06.2016, at 14:02, Augusto Ribeiro Silva <[email protected]> wrote:
> 
> Thanks for the help. Is there any place where I can see how to define 
> capabilities in a non-XML way, i.e., using the Java API.

If you are using uimaFIT, you can declare capabilities using Java annotations, 
e.g.:

@TypeCapability(
        inputs = { 
            "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token",
            "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence" }, 
        outputs = { 
            "de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS" })
public class OpenNlpPosTagger
        extends JCasAnnotator_ImplBase

These will then be present in descriptors created via 
AnalysisEngineFactory.createEngineDescription(...).

Otherwise, if you build your descriptors with the plain UIMA API, something like

Capability capability = new Capability_impl();
...
AnalysisEngineDescription desc = UIMAFramework.getResourceSpecifierFactory()
            .createAnalysisEngineDescription();
...
desc.getAnalysisEngineMetaData().setCapabilities(new Capability[] { capability 
});

Cheers,

-- Richard

Reply via email to