Class: Zenlish::Lex::LexicalEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/zenlish/lex/lexical_entry.rb

Overview

TODO: document

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(theLemma, aLexeme = nil) ⇒ LexicalEntry

Returns a new instance of LexicalEntry.



8
9
10
11
12
# File 'lib/zenlish/lex/lexical_entry.rb', line 8

def initialize(theLemma, aLexeme = nil)
  @lemma = theLemma.dup
  @lexemes = []
  add_lexeme(aLexeme)
end

Instance Attribute Details

#lemmaObject (readonly)

Returns the value of attribute lemma.



5
6
7
# File 'lib/zenlish/lex/lexical_entry.rb', line 5

def lemma
  @lemma
end

#lexemesObject (readonly)

Returns the value of attribute lexemes.



6
7
8
# File 'lib/zenlish/lex/lexical_entry.rb', line 6

def lexemes
  @lexemes
end

Instance Method Details

#add_lexeme(aLexeme) ⇒ Object



14
15
16
# File 'lib/zenlish/lex/lexical_entry.rb', line 14

def add_lexeme(aLexeme)
  lexemes << aLexeme if aLexeme
end