Class: Zenlish::Lex::Lexeme

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#wclassObject (readonly)

Returns Zenlish::WClasses::WordClass.

Returns:

  • Zenlish::WClasses::WordClass



9
10
11
# File 'lib/zenlish/lex/lexeme.rb', line 9

def wclass
  @wclass
end

Instance Method Details

#entryObject

Returns Zenlish::Lex::LexicalEntry.

Returns:

  • Zenlish::Lex::LexicalEntry



18
19
20
# File 'lib/zenlish/lex/lexeme.rb', line 18

def entry
  ObjectSpace._id2ref(@entry)
end

#lemmaObject



22
23
24
# File 'lib/zenlish/lex/lexeme.rb', line 22

def lemma
  entry.lemma
end