Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3280 > unrolled thread

Stanfordparser (or rjb) error on Snow Leopard

Started byBoris Do <borislavd@gmx.net>
First post2011-04-20 19:42 -0500
Last post2011-04-30 11:11 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  Stanfordparser (or rjb) error on Snow Leopard Boris Do <borislavd@gmx.net> - 2011-04-20 19:42 -0500
    Re: Stanfordparser (or rjb) error on Snow Leopard Luiz Nogara <nogara@gmail.com> - 2011-04-30 11:11 -0500

#3280 — Stanfordparser (or rjb) error on Snow Leopard

FromBoris Do <borislavd@gmx.net>
Date2011-04-20 19:42 -0500
SubjectStanfordparser (or rjb) error on Snow Leopard
Message-ID<076209b0fdedcc03438395fce74d2dc8@ruby-forum.com>
I'm having trouble getting stanfordparser to work under Snow Leopard. It
appears to be an rjb issue. I tried the approach suggested at this post
without success:
http://www.foraker.com/resolving-issues-with-rjb-and-rvm-caused-by-snow-leopard-java-update/
The error I'm getting is the following:

ruby-1.9.2-p180 :001 > require 'stanfordparser'
 => true
ruby-1.9.2-p180 :002 > preproc =
StanfordParser::DocumentPreprocessor.new
RuntimeError: Constructor not found
        from
/Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/stanfordparser-2.2.0/lib/java_object.rb:40:in
`new'
        from
/Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/stanfordparser-2.2.0/lib/java_object.rb:40:in
`initialize'
        from
/Users/boris/.rvm/gems/ruby-1.9.2-p180/gems/stanfordparser-2.2.0/lib/stanfordparser.rb:239:in
`initialize'
        from (irb):2:in `new'
        from (irb):2
        from /Users/boris/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in
`<main>'


If I don't follow the approach suggested at the above post, I get a
different error:

ruby-1.9.2-p180 :001 > require 'stanfordparser'
[BUG] cross-thread violation on rb_gc()
(null)

Abort trap


Any ideas?

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [next] | [standalone]


#3741

FromLuiz Nogara <nogara@gmail.com>
Date2011-04-30 11:11 -0500
Message-ID<a976fa683057298991569d9d0ce8dd25@ruby-forum.com>
In reply to#3280
I also followed the instructions of the blog post you mentioned, and
also got the same results. The gem I'm using is the "stanfordparser"
v2.2.0 (https://github.com/jcwilk/stanfordparser)

From the changelog at the Stanford Parser website, I figured the last
version (1.6.6) changed APIs that the ruby wrapper does not understand.

---
Version 1.6.6  2011-04-20   Internal code and API changes (ArrayLists
rather than Sentence; use of CoreLabel objects) to match tagger and
CoreNLP.
---

So, I tried the previous version, which is available at.

http://nlp.stanford.edu/software/stanford-parser-2010-11-30.tgz

I got it to work with this version, but I could not make the simple test
work:

ruby-1.8.7-p334 :003 > require 'stanfordparser'
 => true
ruby-1.8.7-p334 :004 > preproc =
StanfordParser::DocumentPreprocessor.new
 => <DocumentPreprocessor>
ruby-1.8.7-p334 :005 > puts preproc.getSentencesFromString("This is a
sentence.  So is this.")
This
is
a
sentence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web