Class: Zenlish::Lex::LexicalEntry
- Inherits:
-
Object
- Object
- Zenlish::Lex::LexicalEntry
- Defined in:
- lib/zenlish/lex/lexical_entry.rb
Overview
TODO: document
Instance Attribute Summary collapse
-
#lemma ⇒ String
readonly
The lemma (dictionary) form of a word.
- #lexemes ⇒ Array<Lexeme, Rley::Syntax::Terminal> readonly
Instance Method Summary collapse
- #add_lexeme(aLexeme) ⇒ Object
-
#initialize(theLemma, aLexeme = nil) ⇒ LexicalEntry
constructor
A new instance of LexicalEntry.
Constructor Details
#initialize(theLemma, aLexeme = nil) ⇒ LexicalEntry
Returns a new instance of LexicalEntry.
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
#lemma ⇒ String (readonly)
Returns the lemma (dictionary) form of a word.
8 9 10 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 8 def lemma @lemma end |
#lexemes ⇒ Array<Lexeme, Rley::Syntax::Terminal> (readonly)
11 12 13 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 11 def lexemes @lexemes end |
Instance Method Details
#add_lexeme(aLexeme) ⇒ Object
23 24 25 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 23 def add_lexeme(aLexeme) lexemes << aLexeme if aLexeme end |