Class: WordNet::Sense
- Inherits:
-
Object
- Object
- WordNet::Sense
- Includes:
- Constants
- Defined in:
- lib/wordnet/sense.rb
Overview
WordNet sense model class
Constant Summary
Constants included from Constants
Constants::DEFAULT_DB_OPTIONS, Constants::DELIM, Constants::DELIM_RE, Constants::DOMAIN_TYPES, Constants::DomainSymbols, Constants::HOLONYM_SYMBOLS, Constants::HOLONYM_TYPES, Constants::HYPERNYM_SYMBOLS, Constants::HYPERNYM_TYPES, Constants::HYPONYM_SYMBOLS, Constants::HYPONYM_TYPES, Constants::LEXFILES, Constants::MEMBER_SYMBOLS, Constants::MEMBER_TYPES, Constants::MERONYM_SYMBOLS, Constants::MERONYM_TYPES, Constants::POINTER_SUBTYPES, Constants::POINTER_SYMBOLS, Constants::POINTER_TYPES, Constants::SUB_DELIM, Constants::SUB_DELIM_RE, Constants::SYNTACTIC_CATEGORIES, Constants::SYNTACTIC_SYMBOLS, Constants::VERB_SENTS
Class Method Summary collapse
-
.lexical_link(type, typekey = nil) ⇒ Object
Generate a method that will return Synsets related by the given lexical pointer
type.
Instance Method Summary collapse
-
#also_see ⇒ Object
Return the synsets that are lexically linked to this sense via an “also see” link.
-
#antonym ⇒ Object
Return the synsets that are lexically linked to this sense via an “antonym” link.
-
#derivation ⇒ Object
Return the synsets that are lexically linked to this sense via a “derivation” link.
-
#domain_categories ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain category” link.
-
#domain_member_categories ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member category” link.
-
#domain_member_region ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member region” link.
-
#domain_member_usage ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member usage” link.
-
#domain_region ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain region” link.
-
#domain_usage ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain usage” link.
-
#lexlinks ⇒ Object
The lexical links between this sense and its related Synsets.
-
#participle ⇒ Object
Return the synsets that are lexically linked to this sense via a “participle” link.
-
#pertainym ⇒ Object
Return the synsets that are lexically linked to this sense via a “pertainym” link.
-
#synset ⇒ Object
The Synset this is a Sense for.
-
#verb_group ⇒ Object
Return the synsets that are lexically linked to this sense via a “verb group” link.
-
#word ⇒ Object
The Word this is a Sense for.
Class Method Details
.lexical_link(type, typekey = nil) ⇒ Object
Generate a method that will return Synsets related by the given lexical pointer type.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/wordnet/sense.rb', line 32 def self::lexical_link( type, typekey=nil ) # :nodoc: typekey ||= type.to_s.chomp( 's' ).to_sym self.log.debug "Generating a %p method for %p links" % [ type, typekey ] method_body = Proc.new do linkinfo = WordNet::Synset.linktypes[ typekey ] or raise ScriptError, "no such link type %p" % [ typekey ] ssids = self.lexlinks_dataset.filter( linkid: linkinfo[:id] ).select( :synset2id ) self.class.filter( synsetid: ssids ) end define_method( type, &method_body ) end |
Instance Method Details
#also_see ⇒ Object
Return the synsets that are lexically linked to this sense via an “also see” link.
50 |
# File 'lib/wordnet/sense.rb', line 50 lexical_link :also_see, :also |
#antonym ⇒ Object
Return the synsets that are lexically linked to this sense via an “antonym” link.
54 |
# File 'lib/wordnet/sense.rb', line 54 lexical_link :antonym |
#derivation ⇒ Object
Return the synsets that are lexically linked to this sense via a “derivation” link.
58 |
# File 'lib/wordnet/sense.rb', line 58 lexical_link :derivation |
#domain_categories ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain category” link.
62 |
# File 'lib/wordnet/sense.rb', line 62 lexical_link :domain_categories, :domain_category |
#domain_member_categories ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member category” link.
67 |
# File 'lib/wordnet/sense.rb', line 67 lexical_link :domain_member_categories, :domain_member_category |
#domain_member_region ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member region” link.
71 |
# File 'lib/wordnet/sense.rb', line 71 lexical_link :domain_member_region |
#domain_member_usage ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain member usage” link.
75 |
# File 'lib/wordnet/sense.rb', line 75 lexical_link :domain_member_usage |
#domain_region ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain region” link.
79 |
# File 'lib/wordnet/sense.rb', line 79 lexical_link :domain_region |
#domain_usage ⇒ Object
Return the synsets that are lexically linked to this sense via a “domain usage” link.
83 |
# File 'lib/wordnet/sense.rb', line 83 lexical_link :domain_usage |
#lexlinks ⇒ Object
The lexical links between this sense and its related Synsets. Sense -> [ LexicalLinks ] -> [ Synsets ]
24 25 26 27 |
# File 'lib/wordnet/sense.rb', line 24 one_to_many :lexlinks, class: 'WordNet::LexicalLink', key: [ :synset1id, :word1id ], primary_key: [ :synsetid, :wordid ] |
#participle ⇒ Object
Return the synsets that are lexically linked to this sense via a “participle” link.
87 |
# File 'lib/wordnet/sense.rb', line 87 lexical_link :participle |
#pertainym ⇒ Object
Return the synsets that are lexically linked to this sense via a “pertainym” link.
91 |
# File 'lib/wordnet/sense.rb', line 91 lexical_link :pertainym |
#synset ⇒ Object
The Synset this is a Sense for
15 |
# File 'lib/wordnet/sense.rb', line 15 many_to_one :synset, key: :synsetid |
#verb_group ⇒ Object
Return the synsets that are lexically linked to this sense via a “verb group” link.
95 |
# File 'lib/wordnet/sense.rb', line 95 lexical_link :verb_group |
#word ⇒ Object
The Word this is a Sense for
19 |
# File 'lib/wordnet/sense.rb', line 19 many_to_one :word, key: :wordid |