=== And I get the following :
...
[Loaded opennlp.grokkit.Run]
[Loaded opennlp.grokkit.gui.Parameters]
[Loaded java.io.IOException from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\rt.jar]
[Loaded opennlp.common.NLPException]
[Loaded opennlp.common.parse.LexException]
[Loaded opennlp.common.PipelineException]
[Loaded java.lang.StringCoding from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\rt.ja
r]
[Loaded java.lang.ThreadLocal$ThreadLocalMap from C:\PROGRAM FILES\JAVA\J2RE1.4.
1_01\lib\rt.jar]
[Loaded java.lang.ThreadLocal$ThreadLocalMap$Entry from C:\PROGRAM FILES\JAVA\J2
RE1.4.1_01\lib\rt.jar]
[Loaded java.lang.StringCoding$StringDecoder from C:\PROGRAM FILES\JAVA\J2RE1.4.
1_01\lib\rt.jar]
[Loaded java.lang.StringCoding$CharsetSD from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01
\lib\rt.jar]
[Loaded java.io.FileNotFoundException from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\li
b\rt.jar]
grok>
Try using the class opennlp.grok.TextGrok instead of Grokling or grokkit.Run. You'll need to make sure that all the jars in lib/ are in your classpath. Also, look at the scripts in the bin/ directory to see how the classpaths are set up. I suppose these only work for Unix, but could be easily adapted for Windows.
Hope that helps!
Jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No special adaptations are required for windows. The only problem with windows is building grok. The build.bat file doesn't work both on XP and 2000
here is a version that should build grok, as long as you have set your JAVA_HOME and have tools.jar in your CLASSPATH:
set LOCALCLASSPATH=.\lib\ant.jar;.\lib\jakarta-ant-optional.jar;.\lib\jaxp.jar;.\lib\crimson.jar;%JAVA_HOME%\lib\tools.jar;.\lib\jdom.jar;.\lib\antlr-all.jar;.\lib\gnu-regexp.jar
set ANT_HOME=.\lib
Until now, I can't manage making Grok run properly :
Here are the least unsuccessful methods I tried :
I open a command line into :
C:\grok\samples\grammar>
===== FIRST TRY : I type the command that is given in the Readme :
java -verbose -cp C:\grok\lib\opennlp.jar;C:\grok\output_bk\grok-0.6.0.jar; opennlp.grok.Grokling sample.gram
=== And I get the following :
...
[Loaded opennlp.grok.Grokling]
[Loaded opennlp.common.parse.ParseException]
[Loaded opennlp.common.parse.Parser]
[Loaded opennlp.common.parse.Lexicon]
Exception in thread "main" java.lang.NoSuchMethodError: main
[Loaded java.lang.StackTraceElement from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\ rt.jar]
[Loaded java.util.HashMap$KeySet from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\rt.
jar]
[Loaded java.util.HashMap$KeyIterator from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\li
b\rt.jar]
===== SECOND TRY : I type :
java -verbose -cp C:\grok\lib\opennlp.jar;C:\grok\output_bk\grok-0.6.0.jar; opennlp.grokkit.Run simple.gram
=== And I get the following :
...
[Loaded opennlp.grokkit.Run]
[Loaded opennlp.grokkit.gui.Parameters]
[Loaded java.io.IOException from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\rt.jar]
[Loaded opennlp.common.NLPException]
[Loaded opennlp.common.parse.LexException]
[Loaded opennlp.common.PipelineException]
[Loaded java.lang.StringCoding from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\lib\rt.ja
r]
[Loaded java.lang.ThreadLocal$ThreadLocalMap from C:\PROGRAM FILES\JAVA\J2RE1.4.
1_01\lib\rt.jar]
[Loaded java.lang.ThreadLocal$ThreadLocalMap$Entry from C:\PROGRAM FILES\JAVA\J2
RE1.4.1_01\lib\rt.jar]
[Loaded java.lang.StringCoding$StringDecoder from C:\PROGRAM FILES\JAVA\J2RE1.4.
1_01\lib\rt.jar]
[Loaded java.lang.StringCoding$CharsetSD from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01
\lib\rt.jar]
[Loaded java.io.FileNotFoundException from C:\PROGRAM FILES\JAVA\J2RE1.4.1_01\li
b\rt.jar]
grok>
=== Then, I type :
Brazil defeated China
=== And I get the following :
Parsing `Brazil defeated China'...
Syntactic Category
------------------
[Loaded opennlp.grok.util.Params]
==============================================================================
In both cases, I'm having difficulties using Grok.
Any help would be gratefully welcome.
Thank you,
Michelange
Try using the class opennlp.grok.TextGrok instead of Grokling or grokkit.Run. You'll need to make sure that all the jars in lib/ are in your classpath. Also, look at the scripts in the bin/ directory to see how the classpaths are set up. I suppose these only work for Unix, but could be easily adapted for Windows.
Hope that helps!
Jason
No special adaptations are required for windows. The only problem with windows is building grok. The build.bat file doesn't work both on XP and 2000
here is a version that should build grok, as long as you have set your JAVA_HOME and have tools.jar in your CLASSPATH:
set LOCALCLASSPATH=.\lib\ant.jar;.\lib\jakarta-ant-optional.jar;.\lib\jaxp.jar;.\lib\crimson.jar;%JAVA_HOME%\lib\tools.jar;.\lib\jdom.jar;.\lib\antlr-all.jar;.\lib\gnu-regexp.jar
set ANT_HOME=.\lib
%JAVA_HOME%\bin\java -Dant.home=%ANT_HOME% -classpath %LOCALCLASSPATH% org.apache.tools.ant.Main %1
Now about Grokling, in the samples\grammar dir
there are specific instructions on how you should run the tests.
Good luck