Method: WordNet::Synset#semanticlink_dataset
- Defined in:
- lib/wordnet/synset.rb
#semanticlink_dataset(type) ⇒ Object
Return a Sequel::Dataset for synsets related to the receiver via the semantic link of the specified type.
399 400 401 402 403 404 405 406 |
# File 'lib/wordnet/synset.rb', line 399 def semanticlink_dataset( type ) typekey = SEMANTIC_TYPEKEYS[ type ] linkinfo = self.class.linktypes[ typekey ] or raise ArgumentError, "no such link type %p" % [ typekey ] ssids = self.semlinks_dataset.filter( linkid: linkinfo[:id] ).select( :synset2id ) return self.class.filter( synsetid: ssids ) end |