Module: Zenlish::Lang
- Extended by:
- Feature::FeatureStructDefBearer
- Defined in:
- lib/zenlish/lang/dictionary.rb,
lib/zenlish/lang/lemmatizer.rb
Defined Under Namespace
Classes: Lemmatizer
Constant Summary collapse
- Dictionary =
sandbox.create_empty_lexicon
Class Method Summary collapse
Methods included from Feature::FeatureStructDefBearer
[], boolean, enumeration, feature_def, feature_def_dsl, identifier, init_struct_def, struct
Class Method Details
.add_entry(aLemma, aWClassName, aFeatureHash = nil, &aBlock) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/zenlish/lang/dictionary.rb', line 19 def self.add_entry(aLemma, aWClassName, aFeatureHash = nil, &aBlock) entry = Zenlish::Lex::LexicalEntry.new(aLemma) wclass = Dictionary.name2terminal[aWClassName] raise StandardError, "Undefined word class for '#{aLemma}'" unless wclass lexeme = Zenlish::Lex::Lexeme.new(wclass, entry, aFeatureHash) lexeme.instance_exec(&aBlock) if block_given? lexeme.freeze Dictionary.add_entry(entry.freeze) end |