Class: Zenlish::Lex::Lexeme
- Inherits:
-
Object
- Object
- Zenlish::Lex::Lexeme
- Defined in:
- lib/zenlish/lex/lexeme.rb
Overview
A word in the abstract sense; an individual, distinct item of a lexicon that belongs to a word class and of which a number of actual word forms may exist. For instance, the word forms: 'hide', 'hides', 'hid', 'hidden' relate to the lexeme for verb 'hide'. Also called 'dictionary word'.
Instance Attribute Summary collapse
-
#wclass ⇒ Object
readonly
Zenlish::WClasses::WordClass.
Instance Method Summary collapse
-
#entry ⇒ Object
Zenlish::Lex::LexicalEntry.
-
#initialize(aWordClass, anEntry) ⇒ Lexeme
constructor
A new instance of Lexeme.
- #lemma ⇒ Object
Constructor Details
#initialize(aWordClass, anEntry) ⇒ Lexeme
Returns a new instance of Lexeme.
11 12 13 14 15 |
# File 'lib/zenlish/lex/lexeme.rb', line 11 def initialize(aWordClass, anEntry) @wclass = aWordClass @entry = anEntry.object_id anEntry.add_lexeme(self) end |
Instance Attribute Details
#wclass ⇒ Object (readonly)
Returns Zenlish::WClasses::WordClass.
9 10 11 |
# File 'lib/zenlish/lex/lexeme.rb', line 9 def wclass @wclass end |
Instance Method Details
#entry ⇒ Object
Returns Zenlish::Lex::LexicalEntry.
18 19 20 |
# File 'lib/zenlish/lex/lexeme.rb', line 18 def entry ObjectSpace._id2ref(@entry) end |
#lemma ⇒ Object
22 23 24 |
# File 'lib/zenlish/lex/lexeme.rb', line 22 def lemma entry.lemma end |