You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by Congmin min <ma...@gmail.com> on 2010/12/07 19:14:17 UTC

Use of Opennlp

Hello, I am new to this tools. I downloaded 1.5 version, and added the 3 jar
files into my windows 7 environment variable:
C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar

Then I wrote a helloWorld.java to test it, but it says the package can't be
found:

import opennlp.tools.chunker.ChunkSample;

public class Test{
    public static void main(String[] args) {
        System.out.println(" NLP tools ... ");
}


c:\>javac Test.java
Test.java:1: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkSample;
                            ^
1 error

Where was I wrong? Thanks.

Re: Fwd: Fwd: Use of Opennlp

Posted by Congmin min <ma...@gmail.com>.
hi, Jorn:

I am setting up a Web demo for the tool. If it takes nearly one minute to
load all the models from SentenceDetection to Parsing. Is there a way to
make it faster?

sometimes, it is running out of memory.
Thanks

On Tue, Dec 7, 2010 at 4:15 PM, Jörn Kottmann <ko...@gmail.com> wrote:

> The JVM searches the classpath for required classes, in your case
> the opennlp jars are not on the classpath and thats why the runtime
> cannot find the SentenceModel class.
>
> Just add at least the maxent and opennlp-tools jars to your classpath
> and it will stop complaining about missing opennlp classes.
>
> Jörn
>
>
> On 12/7/10 10:08 PM, Congmin min wrote:
>
>> Sorry for the previous messy reply. This is a clear version.
>>
>> but now have a running problem:
>> C:\myclasses>java Test
>> Initializing the NLP tools ...
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> opennlp/tools/sentdet
>> ect/SentenceModel
>>         at Test.initialize(Test.java:42)
>>         at Test.main(Test.java:34)
>> Caused by: java.lang.ClassNotFoundException:
>> opennlp.tools.sentdetect.SentenceMo
>> del
>>         ... 2 more
>>
>> if i run it by passing the parameter, i also got an error:
>> C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
>> Exception in thread "main" java.lang.NoClassDefFoundError: Test
>> Caused by: java.lang.ClassNotFoundException: Test
>>         at java.net.URLClassLoader$1.run(Unknown Source)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>> Could not find the main class: Test.  Program will exit.
>>
>>
>

Re: Fwd: Fwd: Use of Opennlp

Posted by Congmin min <ma...@gmail.com>.
Great! Thanks.

On Tue, Dec 7, 2010 at 1:15 PM, Jörn Kottmann <ko...@gmail.com> wrote:

> The JVM searches the classpath for required classes, in your case
> the opennlp jars are not on the classpath and thats why the runtime
> cannot find the SentenceModel class.
>
> Just add at least the maxent and opennlp-tools jars to your classpath
> and it will stop complaining about missing opennlp classes.
>
> Jörn
>
>
> On 12/7/10 10:08 PM, Congmin min wrote:
>
>> Sorry for the previous messy reply. This is a clear version.
>>
>> but now have a running problem:
>> C:\myclasses>java Test
>> Initializing the NLP tools ...
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> opennlp/tools/sentdet
>> ect/SentenceModel
>>         at Test.initialize(Test.java:42)
>>         at Test.main(Test.java:34)
>> Caused by: java.lang.ClassNotFoundException:
>> opennlp.tools.sentdetect.SentenceMo
>> del
>>         ... 2 more
>>
>> if i run it by passing the parameter, i also got an error:
>> C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
>> Exception in thread "main" java.lang.NoClassDefFoundError: Test
>> Caused by: java.lang.ClassNotFoundException: Test
>>         at java.net.URLClassLoader$1.run(Unknown Source)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>> Could not find the main class: Test.  Program will exit.
>>
>>
>

Re: Fwd: Fwd: Use of Opennlp

Posted by Jörn Kottmann <ko...@gmail.com>.
The JVM searches the classpath for required classes, in your case
the opennlp jars are not on the classpath and thats why the runtime
cannot find the SentenceModel class.

Just add at least the maxent and opennlp-tools jars to your classpath
and it will stop complaining about missing opennlp classes.

Jörn

On 12/7/10 10:08 PM, Congmin min wrote:
> Sorry for the previous messy reply. This is a clear version.
>
> but now have a running problem:
> C:\myclasses>java Test
> Initializing the NLP tools ...
> Exception in thread "main" java.lang.NoClassDefFoundError:
> opennlp/tools/sentdet
> ect/SentenceModel
>          at Test.initialize(Test.java:42)
>          at Test.main(Test.java:34)
> Caused by: java.lang.ClassNotFoundException:
> opennlp.tools.sentdetect.SentenceMo
> del
>          ... 2 more
>
> if i run it by passing the parameter, i also got an error:
> C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
> Exception in thread "main" java.lang.NoClassDefFoundError: Test
> Caused by: java.lang.ClassNotFoundException: Test
>          at java.net.URLClassLoader$1.run(Unknown Source)
>          at java.security.AccessController.doPrivileged(Native Method)
>          at java.net.URLClassLoader.findClass(Unknown Source)
>          at java.lang.ClassLoader.loadClass(Unknown Source)
>          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>          at java.lang.ClassLoader.loadClass(Unknown Source)
> Could not find the main class: Test.  Program will exit.
>


Fwd: Fwd: Use of Opennlp

Posted by Congmin min <ma...@gmail.com>.
Sorry for the previous messy reply. This is a clear version.

but now have a running problem:
C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:42)
        at Test.main(Test.java:34)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        ... 2 more

if i run it by passing the parameter, i also got an error:
C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

Re: Fwd: Use of Opennlp

Posted by Congmin min <ma...@gmail.com>.
        at Test.initialize(Test.java:62)
        at Test.main(Test.java:44)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java -classpath
opennlp-tools-1.5.0.jar;maxent-3.0.0.jar;jwnl-1.3.3
.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:62)
        at Test.main(Test.java:44)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.

C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:62)
        at Test.main(Test.java:44)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

C:\myclasses>javac -classpath opennlp-tools-1.5.0.jar Test.java

C:\myclasses>javac Test.java
Test.java:8: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkSample;
                            ^
Test.java:9: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkerME;
                            ^
Test.java:10: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkerModel;
                            ^
Test.java:11: package opennlp.tools.cmdline.parser does not exist
import opennlp.tools.cmdline.parser.ParserTool;
                                   ^
Test.java:12: package opennlp.tools.namefind does not exist
import opennlp.tools.namefind.NameFinderME;
                             ^
Test.java:13: package opennlp.tools.namefind does not exist
import opennlp.tools.namefind.TokenNameFinderModel;
                             ^
Test.java:14: package opennlp.tools.parser does not exist
import opennlp.tools.parser.Parse;
                           ^
Test.java:15: package opennlp.tools.parser does not exist
import opennlp.tools.parser.Parser;
                           ^
Test.java:16: package opennlp.tools.parser does not exist
import opennlp.tools.parser.ParserFactory;
                           ^
Test.java:17: package opennlp.tools.parser does not exist
import opennlp.tools.parser.ParserModel;
                           ^
Test.java:18: package opennlp.tools.postag does not exist
import opennlp.tools.postag.POSModel;
                           ^
Test.java:19: package opennlp.tools.postag does not exist
import opennlp.tools.postag.POSTaggerME;
                           ^
Test.java:20: package opennlp.tools.sentdetect does not exist
import opennlp.tools.sentdetect.SentenceDetectorME;
                               ^
Test.java:21: package opennlp.tools.sentdetect does not exist
import opennlp.tools.sentdetect.SentenceModel;
                               ^
Test.java:22: package opennlp.tools.tokenize does not exist
import opennlp.tools.tokenize.Tokenizer;
                             ^
Test.java:23: package opennlp.tools.tokenize does not exist
import opennlp.tools.tokenize.TokenizerME;
                             ^
Test.java:24: package opennlp.tools.tokenize does not exist
import opennlp.tools.tokenize.TokenizerModel;
                             ^
Test.java:25: package opennlp.tools.util does not exist
import opennlp.tools.util.Span;
                         ^
Test.java:28: cannot find symbol
symbol  : class SentenceModel
location: class Test
        private static SentenceModel sentModel = null;
                       ^
Test.java:42: cannot find symbol
symbol  : class SentenceModel
location: class Test
                        sentModel = new SentenceModel(sentModelIn);
                                        ^
20 errors

C:\myclasses>javac -classpath opennlp-tools-1.5.0.jar Test.java

C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:42)
        at Test.main(Test.java:34)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:42)
        at Test.main(Test.java:34)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

C:\myclasses>javac Test.java
Test.java:8: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkSample;
                            ^
Test.java:9: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkerME;
                            ^
Test.java:10: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkerModel;
                            ^
Test.java:11: package opennlp.tools.cmdline.parser does not exist
import opennlp.tools.cmdline.parser.ParserTool;
                                   ^
Test.java:12: package opennlp.tools.namefind does not exist
import opennlp.tools.namefind.NameFinderME;
                             ^
Test.java:13: package opennlp.tools.namefind does not exist
import opennlp.tools.namefind.TokenNameFinderModel;
                             ^
Test.java:14: package opennlp.tools.parser does not exist
import opennlp.tools.parser.Parse;
                           ^
Test.java:15: package opennlp.tools.parser does not exist
import opennlp.tools.parser.Parser;
                           ^
Test.java:16: package opennlp.tools.parser does not exist
import opennlp.tools.parser.ParserFactory;
                           ^
Test.java:17: package opennlp.tools.parser does not exist
import opennlp.tools.parser.ParserModel;
                           ^
Test.java:18: package opennlp.tools.postag does not exist
import opennlp.tools.postag.POSModel;
                           ^
Test.java:19: package opennlp.tools.postag does not exist
import opennlp.tools.postag.POSTaggerME;
                           ^
Test.java:20: package opennlp.tools.sentdetect does not exist
import opennlp.tools.sentdetect.SentenceDetectorME;
                               ^
Test.java:21: package opennlp.tools.sentdetect does not exist
import opennlp.tools.sentdetect.SentenceModel;
                               ^
Test.java:22: package opennlp.tools.tokenize does not exist
import opennlp.tools.tokenize.Tokenizer;
                             ^
Test.java:23: package opennlp.tools.tokenize does not exist
but now have a running problem:
C:\myclasses>java Test
Initializing the NLP tools ...
Exception in thread "main" java.lang.NoClassDefFoundError:
opennlp/tools/sentdet
ect/SentenceModel
        at Test.initialize(Test.java:42)
        at Test.main(Test.java:34)
Caused by: java.lang.ClassNotFoundException:
opennlp.tools.sentdetect.SentenceMo
del
        ... 2 more

if i run it by passing the parameter, i also got an error:
C:\myclasses>java -classpath opennlp-tools-1.5.0.jar Test
Exception in thread "main" java.lang.NoClassDefFoundError: Test
Caused by: java.lang.ClassNotFoundException: Test
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Test.  Program will exit.



On Tue, Dec 7, 2010 at 12:57 PM, Jörn Kottmann <ko...@gmail.com> wrote:

> Yes, try to use the "-classpath" argument of javac,
> so you need to write something like this:
>
>
> javac -classpath opennlp-tools-1.5.0.jar Test.java
>
> Jörn
>
>
> On 12/7/10 9:54 PM, Congmin min wrote:
>
>> Thanks. But I added it to my classpath:
>> C:\myclasses\opennlp-tools-1.5.0.jar, and then run "javac Test.java", it
>> shows that error: cant find the packages.
>>
>> Any idea? thanks.
>>
>>
>> ---------- Forwarded message ----------
>> From: Jörn Kottmann<ko...@gmail.com>
>> Date: Tue, Dec 7, 2010 at 10:31 AM
>> Subject: Re: Use of Opennlp
>> To: opennlp-dev@incubator.apache.org
>>
>>
>> Hello,
>> please post questions about the usage on the opennlp-users mailing list.
>>
>> The opennlp-tools-1.5.0.jar must be on the classpath of the compiler.
>>
>> Try something like this:
>> javac -classpath opennlp-tools-1.5.0.jar Test.java
>>
>> Then it will be able to find the referenced ChunkSample class.
>>
>> Hope that helps,
>> Jörn
>>
>>
>> On 12/7/10 7:14 PM, Congmin min wrote:
>>
>>  Hello, I am new to this tools. I downloaded 1.5 version, and added the 3
>>> jar
>>> files into my windows 7 environment variable:
>>> C:\Program Files\Apache Software Foundation\Tomcat
>>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>
>>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>
>>>
>>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar
>>>
>>> Then I wrote a helloWorld.java to test it, but it says the package can't
>>> be
>>> found:
>>>
>>> import opennlp.tools.chunker.ChunkSample;
>>>
>>> public class Test{
>>>     public static void main(String[] args) {
>>>         System.out.println(" NLP tools ... ");
>>> }
>>>
>>>
>>> c:\>javac Test.java
>>> Test.java:1: package opennlp.tools.chunker does not exist
>>> import opennlp.tools.chunker.ChunkSample;
>>>                             ^
>>> 1 error
>>>
>>> Where was I wrong? Thanks.
>>>
>>>
>>>
>

Re: Fwd: Use of Opennlp

Posted by Jörn Kottmann <ko...@gmail.com>.
Yes, try to use the "-classpath" argument of javac,
so you need to write something like this:

javac -classpath opennlp-tools-1.5.0.jar Test.java

Jörn

On 12/7/10 9:54 PM, Congmin min wrote:
> Thanks. But I added it to my classpath:
> C:\myclasses\opennlp-tools-1.5.0.jar, and then run "javac Test.java", it
> shows that error: cant find the packages.
>
> Any idea? thanks.
>
>
> ---------- Forwarded message ----------
> From: Jörn Kottmann<ko...@gmail.com>
> Date: Tue, Dec 7, 2010 at 10:31 AM
> Subject: Re: Use of Opennlp
> To: opennlp-dev@incubator.apache.org
>
>
> Hello,
> please post questions about the usage on the opennlp-users mailing list.
>
> The opennlp-tools-1.5.0.jar must be on the classpath of the compiler.
>
> Try something like this:
> javac -classpath opennlp-tools-1.5.0.jar Test.java
>
> Then it will be able to find the referenced ChunkSample class.
>
> Hope that helps,
> Jörn
>
>
> On 12/7/10 7:14 PM, Congmin min wrote:
>
>> Hello, I am new to this tools. I downloaded 1.5 version, and added the 3
>> jar
>> files into my windows 7 environment variable:
>> C:\Program Files\Apache Software Foundation\Tomcat
>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
>> C:\Program Files\Apache Software Foundation\Tomcat
>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
>> C:\Program Files\Apache Software Foundation\Tomcat
>>
>> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar
>>
>> Then I wrote a helloWorld.java to test it, but it says the package can't be
>> found:
>>
>> import opennlp.tools.chunker.ChunkSample;
>>
>> public class Test{
>>      public static void main(String[] args) {
>>          System.out.println(" NLP tools ... ");
>> }
>>
>>
>> c:\>javac Test.java
>> Test.java:1: package opennlp.tools.chunker does not exist
>> import opennlp.tools.chunker.ChunkSample;
>>                              ^
>> 1 error
>>
>> Where was I wrong? Thanks.
>>
>>


Fwd: Use of Opennlp

Posted by Congmin min <ma...@gmail.com>.
Thanks. But I added it to my classpath:
C:\myclasses\opennlp-tools-1.5.0.jar, and then run "javac Test.java", it
shows that error: cant find the packages.

Any idea? thanks.


---------- Forwarded message ----------
From: Jörn Kottmann <ko...@gmail.com>
Date: Tue, Dec 7, 2010 at 10:31 AM
Subject: Re: Use of Opennlp
To: opennlp-dev@incubator.apache.org


Hello,
please post questions about the usage on the opennlp-users mailing list.

The opennlp-tools-1.5.0.jar must be on the classpath of the compiler.

Try something like this:
javac -classpath opennlp-tools-1.5.0.jar Test.java

Then it will be able to find the referenced ChunkSample class.

Hope that helps,
Jörn


On 12/7/10 7:14 PM, Congmin min wrote:

> Hello, I am new to this tools. I downloaded 1.5 version, and added the 3
> jar
> files into my windows 7 environment variable:
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
> C:\Program Files\Apache Software Foundation\Tomcat
>
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar
>
> Then I wrote a helloWorld.java to test it, but it says the package can't be
> found:
>
> import opennlp.tools.chunker.ChunkSample;
>
> public class Test{
>     public static void main(String[] args) {
>         System.out.println(" NLP tools ... ");
> }
>
>
> c:\>javac Test.java
> Test.java:1: package opennlp.tools.chunker does not exist
> import opennlp.tools.chunker.ChunkSample;
>                             ^
> 1 error
>
> Where was I wrong? Thanks.
>
>

Re: Use of Opennlp

Posted by Jörn Kottmann <ko...@gmail.com>.
Hello,
please post questions about the usage on the opennlp-users mailing list.

The opennlp-tools-1.5.0.jar must be on the classpath of the compiler.

Try something like this:
javac -classpath opennlp-tools-1.5.0.jar Test.java

Then it will be able to find the referenced ChunkSample class.

Hope that helps,
Jörn

On 12/7/10 7:14 PM, Congmin min wrote:
> Hello, I am new to this tools. I downloaded 1.5 version, and added the 3 jar
> files into my windows 7 environment variable:
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
> C:\Program Files\Apache Software Foundation\Tomcat
> 7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar
>
> Then I wrote a helloWorld.java to test it, but it says the package can't be
> found:
>
> import opennlp.tools.chunker.ChunkSample;
>
> public class Test{
>      public static void main(String[] args) {
>          System.out.println(" NLP tools ... ");
> }
>
>
> c:\>javac Test.java
> Test.java:1: package opennlp.tools.chunker does not exist
> import opennlp.tools.chunker.ChunkSample;
>                              ^
> 1 error
>
> Where was I wrong? Thanks.
>