Hi,

here's the pull request: https://github.com/mybyte/ruta-test/pull/1


Yes, more examples would be good, but it also depends on the dev environment and build approaches.


Do you know these projects?

https://github.com/averbis/ruta-pear-archetype

https://github.com/averbis/hello-world-ruta-pear


When the PEAR overhead is ignored, then they provide also some examples for project configuration.


Best


Peter


Am 14.04.2022 um 14:51 schrieb Michael B.:
Hi Peter!

I'd appreciate that pull request. Overall, I feel like we need more skeletons / example projects for RUTA. Maybe it's worth putting a few of those together...

Cheers,

Michael

Am 14/04/2022 um 14:46 schrieb Peter Klügl:
Hi,

I had a quick look at your ruta-test project.

1. There was problem for the paths config of your annotator description. If you use a java/maven project, it is easier to just use the classpath instead of the Ruta paths. So I removed 'descriptor:descriptor' from the pom and moved the descriptor folder to src/main/resources.

2. I added 'TYPESYSTEM descriptor.typeSystemDescriptor;' to your TestProjectMain.ruta (after the UIMAFIT import) and deleted the JCas cover class in 'src/main/java' as it is now generated and located at 'target/...'

3. I added a '.addToIndexes()' in TestAnno so that the annotation is available and added 'EXEC(TestAnno);' in TestProjectMain.ruta so that the annotator is executed. The keyword UIMAFIT is just an import of the analysis engine.

4. I added 'Assert.assertEquals(1, JCasUtil.select(jcas, SomeType.class).size());' to RutaTest.java in order to check if the annotation is created.

If you want, I can open a pull request with the changes for your project or for a fork.

Best

Peter


Am 13.04.2022 um 16:06 schrieb Michael B.:
Hi everyone!

I'm at a loss here. Trying to create a basic RUTA project, but I just can't get it to work. I'd like to include a custom Engine (Java code!) that needs a few maven dependencies. I just can't get RUTA (via ENGINE/TYPESYSTEM) to properly include and initialize Java annotators.

What I tried so far:

- Create project using archetype

- Add code for custom AE

- Add TS and AE descriptors in ./descriptor folder, run JCASGen

- Add <buildPath>descriptor:descriptor</buildPath> to pom (in the ruta-maven-plugin section). ./descriptor folder is configured successfully as part of build path

Issues:

- When using ENGINE aeDescriptor in script, project doesn't run:

Caused by: java.io.FileNotFoundException: class path resource [aeDescriptor.xml] cannot be resolved to URL because it does not exist

- TYPESYSTEM typeSystemDescriptor <- works in editor, but maven pom / task throws an error (no details, assuming name/path can't be resolved)

- UIMAFIT de.miba.TestAnno works (and can be executed in ruta script), but Types/TS missing, so runtime errors.

Any hints or an example project where this works would be highly appreciated! I've uploaded the skeleton to https://github.com/mybyte/ruta-test


Cheers,

Michael



--
Dr. Peter Klügl
Head of Text Mining/Machine Learning

Averbis GmbH
Salzstr. 15
79098 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.klu...@averbis.com
Web: https://averbis.com

Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó

Reply via email to