JULIELab / jcore-base

Base modules of JCoRe
BSD 2-Clause "Simplified" License
22 stars 11 forks source link

can't find Sentence definition in jcore-types #27

Closed hit56 closed 7 years ago

khituras commented 7 years ago

Hi hit56,

You can find the Sentence definition in the descriptor https://github.com/JULIELab/jcore-base/blob/master/jcore-types/src/main/resources/de/julielab/jcore/types/jcore-morpho-syntax-types.xml <https://github.com/JULIELab/jcore-base/blob/master/jcore-types/src/main/resources/de/julielab/jcore/types/jcore-morpho-syntax-types.xml. Its name is de.julielab.jcore.types.Sentence.

If this doesn’t help with your issue, please give us a few more details so we can understand the problem better.

Cheers!

Erik

On 13 Mar 2017, at 04:16, hit56 notifications@github.com wrote:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JULIELab/jcore-base/issues/27, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbucNSs8_d8GuubOM6voldbh1anGtNsks5rlLTygaJpZM4MazYW.

hit56 commented 7 years ago

Hi Erik,

I mean in the folder "jcore-base/jcore-types/src/main/java/" there can not find Sentence.java.

When I compile the whole project. This file can't compiled successful: https://github.com/JULIELab/jcore-base/blob/master/jcore-jsbd-ae/src/main/java/de/julielab/jcore/ae/jsbd/main/SentenceAnnotator.java

The 40th line in that file is: import de.julielab.jcore.types.Sentence;

The IntelliJ IDEA shows the ERROR: Cannot resolve symbol 'Sentence'.

Thank you for your answer.

khituras commented 7 years ago

Hi hit56,

ah, I understand. As you may know, UIMA creates the actual Java classes from the Type System descriptors. You would need to use the UIMA JCasGen tool to create the classes. For this, the convenience descriptor "jcore-all-types.xml" exists that imports all other Type System Descriptors. In Eclipse there is a UIMA plugin, the "Component Descriptor Editor" which offers a button for this at the "Type System" tab. For IntelliJ, I don't know. However, the JCasGen script is just a normal UIMA tool. You could just install UIMA (basically, download it from https://uima.apache.org/downloads.cgi, unpack it and set the UIMA_HOME environment variable to the unpacked directory) and build the types.

However, this issue came up within our group just yesterday. Perhaps we should consider to have a build script call the JCasGen script.

@fmatthies , @hellrich , @buechel What do you think?

hellrich commented 7 years ago

Couldn't we simply use the JCasGen Maven plugin? https://uima.apache.org/d/uimaj-2.6.0/tools.html#ugr.tools.jcasgen.maven_plugin

svenbuechel commented 7 years ago

I can imagine not checking in java class may lead to some hard to find issues when getting started with JCoRe. So I would be in favor of checking them in (if there is not some problem with that we haven't talked about yet).

fmatthies commented 7 years ago

The pom.xml of jcore-types features now the JCasGen Maven plugin, that @hellrich mentioned. @hit56, I tested it with Intellij IDEA and after importing jcore-base, I could rightclick on jcore-types > Maven > Generate Sources and Update Folder and the Java files were sucessfully created, therefore fixing the error

The IntelliJ IDEA shows the ERROR: Cannot resolve symbol 'Sentence'.

(maybe someone can look into the issue why they aren't created on import and/or checking if this holds true for Eclipse, as well).

@buechel, I would leave it as it is right now and not committing the Java files, since they arent't source code that is improved/changed in any way. All changes take place in the xml files.

hit56 commented 7 years ago

Thank you for all your answers.

I've tried to update the pom.xml under "jcore-types" using the JCasGen Maven plugin as @hellrich mentioned. But new ERROR occured: jcore_error

I thought the respository may be not set properly. So I tried many respositories in http://stackoverflow.com/questions/161819/what-are-main-best-maven-respositories-to-use, and tried different version of "jcasgen-maven-plugin" from 2.4.1 to 2.9.0, the ERROR still exists.

I wish you can paste your pom.xml here.@fmatthies Thank you very much.

hellrich commented 7 years ago

@hit56 @fmatthies has already updated the pom.xml in our master branch: https://github.com/JULIELab/jcore-base/blob/master/jcore-types/pom.xml

hit56 commented 7 years ago

Great. I see. My problem has been solved! Thank you!