[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby-wordnet: traverse

Paul Nulty

2/20/2007 5:08:00 PM

Hello,

is anybody familiar with the Ruby-Wordnet module? If so, do you have
any idea about this error?


/usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:104:in
`initialize': undefined method `index' for nil:NilClass
(NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:73:in
`parse'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:769:in
`pointers'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:768:in
`pointers'
from /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:767:in
`pointers'
from /usr/local/lib/ruby/1.8/sync.rb:229:in `synchronize'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:766:in
`pointers'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:810:in
`fetchSynsetPointers'
... 7 levels...
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:693:in
`traverse'
from /usr/local/lib/ruby/site_ruby/1.8/wordnet/synset.rb:705:in
`traverse'
from /home/paul/ruby/wntest.rb:56
from /home/paul/ruby/wntest.rb:45


caused by this code:

k = lex.lookupSynsets("hospital", WordNet::Noun )
puts k[0].traverse(:hypernyms)

problem is that it randomly works for lots of words but not for
others. it doesn't work for "hospital" or "vessel" but does for almost
all other words in my set.

3 Answers

Michael Granger

2/20/2007 6:29:00 PM

0

On Feb 20, 2007, at 9:10 AM, Paul Nulty wrote:

> is anybody familiar with the Ruby-Wordnet module? If so, do you have
> any idea about this error?

I am familiar with it, and this is a bug in the 0.02 release:

http://deveiate.org/projects/Ruby-WordNe...

It has been fixed in the SVN version and the 20061008 snapshot that's
posted to:

http://deveiate.org/projects/Rub...

I have some stuff left to commit before creating a new release, but
I'll try to get that done by Friday.

--
Michael Granger <ged@FaerieMUD.org>
Rubymage, Architect, Believer
The FaerieMUD Consortium <http://www.FaerieMU...
ruby -e "p 12383406064495388618631689469409153107.to_s(36).tr('z',' ')"




Paul Nulty

2/20/2007 6:43:00 PM

0

Great, thank you!

W/Q

6/8/2012 5:27:00 AM

0

On Jun 8, 12:19 am, JRStern <JRSt...@foobar.invalid> wrote:
> On Thu, 7 Jun 2012 18:37:28 -0700 (PDT), "W/Q" <i...@email.com> wrote:
> >On Jun 7, 8:53 pm, JRStern <JRSt...@foobar.invalid> wrote:
> >> On Thu, 7 Jun 2012 16:23:13 -0700 (PDT), "W/Q" <i...@email.com> wrote:
> >> >The derivative market, or CDOs, worked off the subprimes.
>
> >> Only partially, in large part it worked off itself, and that was never
> >> gonna work, bunch of greedy damn fools.  It's the CDS market and AIG
> >> that was the first thing to break, and it was GOING to break because
> >> it had leveraged the bubble up the wazoo, and bubbles are a common
> >> financial phenomenon that SHOULD have been anticipated and was not.
>
> >Actually, it was anticipated by the likes of just about everyone who
> >had a major stake in CDOs.  AIG, in fact, got wind of the bad CDO
> >market very early and stopped selling credit protection against them
> >in early 2006 while Merrill Lynch found it was getting harder to sell
> >its super senior tranche CDOs, Magnetar began creating CDOs to fail on
> >purpose and both JP Morgan and Goldman Sachs began weaning themselves
> >off subprimes.  So everyone knew what was going on in 2006, especially
> >Countrywide which had the lion's share of the subprime market and now
> >looked to repackage their worthless CDOs and then sold them off to
> >unsuspecting buyers to unload them quickly and still make a fast
> >killing on them at the same time.  The only people that really seemed
> >to be clued out were the Federal Treasury, Congress and the Bush
> >administration.  A 4-part CBC documentary called Meltdown and the
> >docufilm Inside Job are both eye-openers as to what went on.
>
> The whole concept of CDS is bad, IMHO.  If they stopped in 2006, why
> did they drop dead in Feb 2008?  The truth is probably uglier than any
> expose you've yet seen.
>
> >> >> Now, most right-wingers today say the CRA was a left wing plot,
> >> >> forgetting that for many years the right thought that home ownership
> >> >> was so important, it was worth some goverment money and risk to
> >> >> encourage it.
>
> >> >Bush proved that with his American Dream nightmare.
>
> >> Enough with the BDS.
>
> >Well, it didn't all come out of thin air and the buck had to stop
> >somewhere, so who was in charge at the time?  Look, if it had been
> >Clinton or Obama, I'd be blaming either of them just as much.  Facts
> >are facts and Bush was at the helm at the time - deal with it, he's
> >not some kind of sacred untouchable figure that should be revered
> >despite all his grave avoidable errors and oversights.
>
> But this was the culmination of ten years, arguably 50, of bipartisan
> policies, none of which were ever under the direct control of the
> president.  You want to blame Bush for any of this, then I would blame
> Obama for not having fixed everything by now.

You expect Obama to fix something in three years that took 10-50 years
to undo? Get real. That's like asking him to reverse the national
debt of $16 trillion back to Bush's $11 trillion when he left office
just as if nothing ever happened. Even Reagan couldn't put Humpty
Dumpty fully back together again in his 8 years. It's one thing for
something to be a culmination of 10 years worth of abuse (let's not
get delusional about any 50 years), it's something entirely else when
the problem clearly exists and Bush still decides to add fuel to the
fire. Besides, his American Dream nightmare, here is something else
he threw into the fire to fabricate the "successful" years of his
economy, 2003-07:

http://online.wsj.com/article/SB1232153277874...

So, essentially what he did was not only allow deregulation to rule
the day, if only because he didn't understand the negatives of what
that would entail, but he resuscitated an economy virtually on debt
which, anyone conscious enough in life would realize, could only
inevitably lead to a financial cataclysm with the way subprimes were
going.


>
> Neither is a rational position, and we are not going to get this fixed
> by absurd name-calling.
>
> >When does it not become a dead cat bounce?  At 10 million jobs
> >created, 15 million, 30 million?  You're playing with arbitrary
> >numbers to justify a self-created flawed view of what constitutes
> >recovery.
>
> I'd say six months of 300,000+ job creation, or a net number of jobs
> in the US economy at least equal to Jan 2008, or an unemployment level
> below 8% with a labor participation rate equal to Jan 2008.

That's asking for a lot from a president who gets absolutely no
cooperation from Republicans who refuse to pass jobs bills. That
300,000 per month figure could easily be met with major infrastructure
projects that need to be done across the country, not only through
direct employment for those projects but also through spin-off and
peripheral employment related to all those projects. Tell your
Republican Congressman to get off his obstructionist ass and pass the
infrastructure jobs bill.


>
> I'm not asking much, but I am asking something beside blatant lies.
>
> J.