lib/zenlish/lex/lexicon.rb in zenlish-0.2.03 vs lib/zenlish/lex/lexicon.rb in zenlish-0.2.04
- old
+ new
@@ -43,14 +43,15 @@
lexeme = candidate if candidate.wclass.kind_of?(aWordClass)
end
lexeme
else
- begin
- lemma2entry.fetch(aLemma).lexemes.first
- rescue NoMethodError => exc
- $stderr.puts "Multiple lexemes for #{aLemma}"
- raise exc
+ entry = lemma2entry.fetch(aLemma)
+ if entry.kind_of?(Array)
+ err_msg = "Multiple lexemes for #{aLemma}"
+ raise StandardError, err_msg
+ else
+ entry.lexemes.first
end
end
end
# @param aTerminal [Rley::Syntax::Terminal]