lib/zenlish/lex/lexicon.rb in zenlish-0.1.25 vs lib/zenlish/lex/lexicon.rb in zenlish-0.2.00
- old
+ new
@@ -1,10 +1,11 @@
module Zenlish
module Lex
# A lexicon is a collection of lexical entries.
# Every entry is associated with one one more lexemes.
class Lexicon
+ # @return [Array<Lex::LexicalEntry>] entries in the lexicon
attr_reader :entries
attr_reader :lemma2entry
# The list of terminal symbols. Examples of terminal symbols:
# - word classes,
@@ -18,9 +19,11 @@
@terminals = []
@name2terminal = {}
end
# @param aLemma[String] retrieve the lexeme form the given "head word".
+ # @param aWordClass [WordClasses::WordClass, NilClass] the word class of
+ # the lexeme.
def get_lexeme(aLemma, aWordClass = nil)
if aWordClass
lexeme = nil
candidate = nil