Newbie Help: findMatchingCallableForArgs error

I'm unable to get a simple ruby script to work that makes use of a Java
class and could use some assistance. I've read all through the wiki and
tried some googling, but no luck.

JRuby Version:
jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) 64-Bit
Server VM 1.7.0_09-b05 [darwin-x86_64]

Java Version:
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

I'm trying to create a super simple ruby script that interfaces with the
Stanford NLP Parser (Java). For now I'm just trying to recreate, in
Ruby, a the first line from their Java demo. I've run the demo and it
runs fine. Here is a snippet of the Java code:


import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import edu.stanford.nlp.objectbank.TokenizerFactory;
import edu.stanford.nlp.process.CoreLabelTokenFactory;
import edu.stanford.nlp.process.DocumentPreprocessor;
import edu.stanford.nlp.process.PTBTokenizer;
import edu.stanford.nlp.ling.CoreLabel;
import edu.stanford.nlp.ling.HasWord;
import edu.stanford.nlp.ling.Sentence;
import edu.stanford.nlp.trees.*;
import edu.stanford.nlp.parser.lexparser.LexicalizedParser;

class ParserDemo {

  public static void main(String[] args) {
    LexicalizedParser lp =

Here is my simple jruby script:

require './stanford-parser.jar'
require './stanford-parser-models.jar'

java_import "edu.stanford.nlp.parser.lexparser.LexicalizedParser"

lp =
puts "Done"

I get this error. Any help is appreciated. `findMatchingCallableForArgs':
java.lang.ArrayIndexOutOfBoundsException: 2
  from `matchingCallableArityN'
  from `findCallable'
  from `call'
  from `call'
  from `cacheAndCall'
  from `call'
  from blah.rb:6:in `__file__'
  from blah.rb:-1:in `load'
  from `runScript'
  from `runScript'
  from `runNormally'
  from `runFromMain'
  from `doRunFromMain'
  from `internalRun'
  from `run'
  from `run'
  from `main'


Posted via

Sorry, meant to post that to the JRuby forum. Please disregard.


Posted via