question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If you try to loop through senses first, hypernym_paths() hangs

See original GitHub issue

Hi,

if you try to loop through senses, then try to find hypernym paths, the code hangs. Looping through synsets is fine!

For example, the code below will print the path for the synset in the first loop, but hang in the second loop.

##
## MWP
##

import wn
en = wn.Wordnet('omw-en:1.4')

organism = en.synsets(ili='i35563')[0] #beast

for ss in en.synsets(pos='n'):
    if ss == organism:
        print(ss.hypernym_paths())
                
for s in en.senses(pos='n'):
    ss == s.synset()
    if ss == organism:
        print(ss.hypernym_paths())

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fcbondcommented, Jan 21, 2022

Hi,

It is on my todo list, but might have to wait until after the move. No rush I think.

On Fri, Jan 21, 2022 at 1:01 PM Michael Wayne Goodman < @.***> wrote:

@fcbond https://github.com/fcbond just checking in. Do you think you can do this, or shall I?

— Reply to this email directly, view it on GitHub https://github.com/goodmami/wn/issues/157#issuecomment-1018181981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIPZRTEM5IXRZL2AXOGHUDUXDSA3ANCNFSM5LEP57TA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

– Francis Bond https://fcbond.github.io/ Division of Linguistics and Multilingual Studies Nanyang Technological University

0reactions
goodmamicommented, Jun 18, 2022

The synset issue was apparently resolved in #170. Sense.word() still has the same problem, though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ling 581: Lexical semantics assignment - Jean Mark Gawron
Write a program which takes a synset ss and a path distance p and returns the set of synsets that can by reached...
Read more >
WordNet: Iterate over synsets - python - Stack Overflow
hypernym_paths() returns a list of list of SynSet s. Hence if element == 'person': tries to compare a SynSet object against a string....
Read more >
QuickGraph#17 The English WordNet in Neo4j (part 2)
Let's try to formalise this simple hypothesis in a query: distance in the graph and presence/absence of antonym relationship as indicators of ...
Read more >
Sample usage for wordnet - NLTK
path_similarity(synset2): Return a score denoting how similar two word senses are, based on the shortest path that connects the senses in the is-a...
Read more >
2 Accessing Text Corpora and Lexical Resources
When we defined emma, we invoked the words() function of the gutenberg object in NLTK's corpus package. But since it is cumbersome to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found