Search code examples
uimarutadkpro-core

How to resolve ruta script errors from GermanNovel example project (dkpro with ruta)?


  1. I imported the GermanNovel example project (downloaded basically from one of the uima-ruta releases at https://github.com/apache/uima-ruta/releases) into eclipse as a maven project. I imported it as maven because I found a pom.xml file.

  2. I find an error in the Main.ruta script stating, "GeneratedDKProCoreTypes" not found, but GeneratedDKProCoreTypes.xml exists in the descriptor folder.

  3. If I change the version of de.tudarmstadt.ukp.dkpro.core.treetagger-asl dependency's version from 1.5.0 to 1.7.0, then the class TreeTaggerPosLemmaTT4J is not found. Is it deprecated or something ? Should I be using some other class(es) and type(s) instead ?

Main.ruta

PACKAGE uima.ruta.example;

IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM GeneratedDKProCoreTypes AS pos;
IMPORT de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma FROM GeneratedDKProCoreTypes;

UIMAFIT de.tudarmstadt.ukp.dkpro.core.stanfordnlp.StanfordSegmenter;
UIMAFIT de.tudarmstadt.ukp.dkpro.core.treetagger.TreeTaggerPosLemmaTT4J;

SCRIPT uima.ruta.example.Name;

Document{-CONTAINS(pos.POS)} -> {
    Document{-> SETFEATURE("language", "de")};
    Document{-> EXEC(StanfordSegmenter)};
    Document{-> EXEC(TreeTaggerPosLemmaTT4J, {pos.POS})};
};

Document{-> CALL(Name)};

Solution

  • The TreeTaggerPosLemmaTT4J was renamed to TreeTaggerPosTagger.

    See also the DKPro Core 1.7.0 component list.

    Additional aggregate information from Peter's comments:

    The example project uses maven only for the dependency management. The ruta scripts are built without maven because the project was created before ruta supported maven. If you copy the stuff to another maven project, the type system need to be located in the root of the classpath, e.g., src/main/resources

    The line IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM GeneratedDKProCoreTypes AS pos; needs to include the package the type system is located in. If the xml file is located at src/main/resources/my/package, then the line should look like ... FROM my.package.GeneratedDKProCoreTypes AS pos Disclosure: I am a DKPro Core developer.