uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Austina <olivier.aust...@gmail.com>
Subject Re: Getting UIMA ruta annotations
Date Tue, 20 Oct 2015 12:41:10 GMT
Hi Peter,

Thank you for your reply. I have only red the UIMA Tools Guide and Reference
<https://uima.apache.org/downloads/releaseDocs/2.2.2-incubating/docs/html/tools/tools.html>
and the UIMA ruta documentation. It seems that I have to check the UIMA
Tutorial and Developers' Guides
<https://uima.apache.org/d/uimaj-current/tutorials_and_users_guides.pdf>
also. Thank you.

Regards
Olivier


2015-10-20 11:15 GMT+02:00 Peter Kl├╝gl <peter.kluegl@averbis.com>:

> Hi,
>
> you can access these annotations like any other annotation in UIMA.
>
> ... with plain UIMA:
>
> Type yearType = cas.getTypeSystem().getType("uima.ruta.example.Year");
> AnnotationIndex<AnnotationFS> annotationIndex =
> cas.getAnnotationIndex(yearType);
> for (AnnotationFS each : annotationIndex) {
>   System.out.println(each.getCoveredText());
> }
>
> ... with JCas cover classes and uimaFIT:
>
> for (Year year : JCasUtil.select(jCas, Year.class)) {
>    System.out.println(year.getCoveredText());
> }
>
> If you are familiar with maven, you should take a look at the new
> example project "ruta-maven-example".
>
> Best,
>
> Peter
>
>
> Am 17.10.2015 um 12:52 schrieb Olivier Austina:
> > Hi,
> > I am learning UIMA ruta. How to get annotations from a java program? I
> > follow this code in the UIMA ruta document:
> >
> > File specFile = new File("pathToMyWorkspace/MyProject/descriptor/"+
> >     "my/package/MyScriptEngine.xml");
> > XMLInputSource in = new XMLInputSource(specFile);
> > ResourceSpecifier specifier = UIMAFramework.getXMLParser().
> >     parseResourceSpecifier(in);
> > // for import by name... set the datapath in the ResourceManager
> > AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
> > CAS cas = ae.newCAS();
> > cas.setDocumentText("This is my document.");
> > ae.process(cas);
> >
> > How to print for example the type Year for the ExampleProject in UIMA
> > ruta source release ? Thank you.
> >
> > Regards
> > Olivier
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message