On Thu, Dec 11, 2008 at 7:22 AM, project2501 <
dar...@ontrenet.com> wrote:
> I tried the suggestion given to me a while ago for the new wordnet
> API on 0.9.6 and get this error:
>
>>>> wn.Synset._from_pos_and_offset('n', 8685677)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: 'WordNetCorpusReader' object has no attribute 'Synset'
>
> Maybe there was an adjustment to the API since then?
Yes. When Edward added the WordNetCorpusReader, he changed a bunch of the APIs.
>>> from nltk.corpus import wordnet
>>> wordnet._synset_from_pos_and_offset('n', 8685677)
Synset('sign_of_the_zodiac.n.01')
I don't know where the documentation for the new APIs are though - I
just found this by doing ``dir(wordnet)``. Can someone point Darren to
the new APIs?
Steve
> On Fri, 2008-10-31 at 15:01 -0600, Steven Bethard wrote:
>> Ahh, yes. That's what I thought you might be doing. Note the
>> documentation for the -o option describes these as "synset offsets",
>> not
>> "synset IDs" (
http://wordnet.princeton.edu/man/wn.1WN):
>>
>> -o
>> Display synset offset of each synset.
>>
>> In the new WordNet API, you can use Synset._from_pos_and_offset to get
>> the same kind of functionality:
>>
>> >>> wn.Synset._from_pos_and_offset('n', 8685677)
>> Synset('sign_of_the_zodiac.n.01')
>>
>> Steve
>
> >
>
--
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
--- Bucky Katt, Get Fuzzy