doches/rwordnet

View on GitHub
examples/full_hypernym.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'rwordnet'

# Find the word 'dog'
lemma = WordNet::Lemma.find("dog", :noun)
# Find all the synsets for 'dog', and pick the first one.
synset = lemma.synsets[0]
puts synset
# Print the full hypernym derivation for the first sense of 'dog'.
synset.expanded_hypernyms.each { |d| puts d }