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.

Parameters:

  • theLemma (String)

    lemma (= citation form), a word form used conventionnaly to represent a lexeme.

  • aLexeme (Lexeme, NilClass) (defaults to: nil)

    the lexeme to link with lexical entry.



16
17
18
19
20
# File 'lib/zenlish/lex/lexical_entry.rb', line 16

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

Instance Attribute Details

#lemmaString (readonly)

Returns the lemma (dictionary) form of a word.

Returns:

  • (String)

    the lemma (dictionary) form of a word.



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

def lemma
  @lemma
end

#lexemesArray<Lexeme, Rley::Syntax::Terminal> (readonly)

Returns:

  • (Array<Lexeme, Rley::Syntax::Terminal>)


11
12
13
# File 'lib/zenlish/lex/lexical_entry.rb', line 11

def lexemes
  @lexemes
end

Instance Method Details

#add_lexeme(aLexeme) ⇒ Object

Parameters:

  • aLexeme (Lexeme, NilClass)

    the lexeme to link with lexical entry.



23
24
25
# File 'lib/zenlish/lex/lexical_entry.rb', line 23

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