Hello, I am trying to implement a collection of java classes from the Stanford NLP Parser in jRuby
I am able to implement regular Java in jRuby, but not the Stanford Parser classes
#my requires/imports/includes, included multiple versions to be safe
require 'java'
include Java
require 'c:\\stanford-parser\\stanfordparser.jar'
require 'C:\\Stanford-Parser\\Current\\stanford-parser.jar'
require 'c:\\sun\\stanfordparser'
require 'rubygems'
include_class 'edu.stanford.nlp.parser.lexparser.LexicalizedParser'
#try to create an object of the java class i am importing, LexicalizedParser
lp = edu.stanford.nlp.parser.lexparser.LexicalizedParser
#the line above is what causes the error
#check if regular Java is working
list = java.util.ArrayList.new
a = "1"
b = "2"
list.add(a)
list.add(b)
d = list[0]
puts d # all of this works
I get this error
~\rubyjavatest\lib\main.rb:15: undefined local variable or method `edu' for main:Object (NameError)
(the ~ represents I cut out the whole path to shorten this)
also if I try this:
lp = java::edu::stanford::nlp.parser::lexparser::LexicalizedParser
I get this error
~\rubyjavatest\lib\main.rb:15: cannot load Java class java.edu.stanford.nlp.parser.lexparser.LexicalizedParser (NameError)
Any help would be great!