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.
14 15 16 17 18 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 14 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.
6 7 8 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 6 def lemma @lemma end |
#lexemes ⇒ Array<Lexeme, Rley::Syntax::Terminal> (readonly)
9 10 11 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 9 def lexemes @lexemes end |
Instance Method Details
#add_lexeme(aLexeme) ⇒ Object
21 22 23 |
# File 'lib/zenlish/lex/lexical_entry.rb', line 21 def add_lexeme(aLexeme) lexemes << aLexeme if aLexeme end |