Method: WordNet::Synset.semantic_link
- Defined in:
- lib/wordnet/synset.rb
.semantic_link(type) ⇒ Object
Generate methods that will return Synsets related by the given semantic pointer type.
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/wordnet/synset.rb', line 376 def self::semantic_link( type ) self.log.debug "Generating a %p method" % [ type ] ds_method_body = Proc.new do self.semanticlink_dataset( type ) end define_method( "#{type}_dataset", &ds_method_body ) ss_method_body = Proc.new do self.semanticlink_dataset( type ).all end define_method( type, &ss_method_body ) self.semantic_link_methods << type.to_sym end |