If you try to loop through senses first, hypernym_paths() hangs
See original GitHub issueHi,
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:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
– Francis Bond https://fcbond.github.io/ Division of Linguistics and Multilingual Studies Nanyang Technological University
The synset issue was apparently resolved in #170.
Sense.word()
still has the same problem, though.