Yanick Nedderhoff
Yanick Nedderhoff

Reputation: 1244

How to correctly integrate OpenNLP API in an Eclipse project?

I want to use the sentencer through the API in my Java program, which is very well documented here: http://opennlp.apache.org/documentation/1.6.0/manual/opennlp.html#tools.sentdetect.detection.api, and has also been described here: How to use OpenNLP with Java?

I downloaded the apache-opennlp-1.6.0-bin.tar.gz from here: http://apache.lauf-forum.at/opennlp/opennlp-1.6.0/

But what I can't find anywhere is how to install OpenNLP such that I can import it in my Java programm. I tried to simply put the .jar in my workspace, which didn't help. I don't find any documentation on that on the OpenNLP page.

Upvotes: 1

Views: 1894

Answers (1)

Yanick Nedderhoff
Yanick Nedderhoff

Reputation: 1244

Ok, I think I figured it out myself.

I simply had to put the openNLP folder somewhere, then right-click the Project and go to

Build Path --> Configure Build Path

click the Libraries tab, click Add External JARs... and navigate to the OpenNLP jar file.

Then I could import classes, such as

import opennlp.tools.sentdetect.SentenceDetectorME;

without any problems.

Upvotes: 2

Related Questions