lib/zenlish/lex/lexicon.rb in zenlish-0.2.05 vs lib/zenlish/lex/lexicon.rb in zenlish-0.2.06
- old
+ new
@@ -1,13 +1,15 @@
+# frozen_string_literal: true
+
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
-
+
# @return [Hash{String => Lex::LexicalEntry}] the lexical entry for the given lemma.
attr_reader :lemma2entry
# The list of terminal symbols. Examples of terminal symbols:
# - word classes,
@@ -21,11 +23,11 @@
@terminals = []
@name2terminal = {}
end
# @param aLemma[String] retrieve the lexeme form the given "head word".
- # @param aWordClass [WordClasses::WordClass, NilClass] the word class of
+ # @param aWordClass [WordClasses::WordClass, NilClass] the word class of
# the lexeme.
# @return [Lex::Lexeme]
def get_lexeme(aLemma, aWordClass = nil)
if aWordClass
lexeme = nil
@@ -81,9 +83,8 @@
end
else
aHash[aKey] = aValue
end
end
-
end # class
end # module
end # module