unless defined?(Zenlish::Lang::Dictionary) module Zenlish module Lang require_relative '../lex/empty_lexicon_factory' require_relative '../lex/lexical_entry' require_relative '../lex/lexeme' sandbox = Object.new sandbox.extend(Zenlish::Lex::EmptyLexiconFactory) Dictionary = sandbox.create_empty_lexicon def self.add_entry(aLemma, aWClassName) 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).freeze Dictionary.add_entry(entry.freeze) end # Our minimalistic lexicon add_entry('a', 'IndefiniteArticle') add_entry('about', 'Preposition') add_entry('above', 'Preposition') add_entry('after', 'Adverb') add_entry('after', 'SubordinatingConjunction') add_entry('alive', 'Adjective') add_entry('all', 'IndefiniteQuantifier') add_entry('another', 'Adjective') add_entry('as', 'ComparativeParticle') add_entry('at', 'Preposition') add_entry('bad', 'Adjective') add_entry('be', 'AuxiliaryBe') add_entry('be', 'IrregularVerbBe') add_entry('because', 'SubordinatingConjunction') add_entry('before', 'Adverb') add_entry('before', 'SubordinatingConjunction') add_entry('big', 'Adjective') add_entry('can', 'ModalVerbCan') add_entry('do', 'AuxiliaryDo') add_entry('do', 'IrregularVerbDo') add_entry('false', 'Adjective') add_entry('far', 'Adverb') add_entry('feel', 'IrregularVerb') add_entry('for', 'Preposition') add_entry('from', 'Preposition') add_entry('good', 'Adjective') add_entry('have', 'IrregularVerbHave') add_entry('happen', 'RegularVerb') add_entry('hear', 'IrregularVerb') add_entry('here', 'Adverb') add_entry('I', 'PersonalPronoun') add_entry('if', 'SubordinatingConjunction') add_entry('in', 'Preposition') add_entry('inside', 'Preposition') add_entry('kind', 'CommonNoun') add_entry('know', 'IrregularVerbKnow') add_entry('like', 'Preposition') add_entry('living', 'Adjective') add_entry('long', 'Adjective') add_entry('many', 'IndefiniteQuantifier') add_entry('me', 'PersonalPronoun') add_entry('moment', 'CommonNoun') add_entry('more', 'Adjective') add_entry('more', 'Adverb') add_entry('move', 'RegularVerb') add_entry('much', 'Adverb') add_entry('near', 'Preposition') add_entry('near to', 'Preposition') add_entry('now', 'Adverb') add_entry('not', 'AdverbNot') add_entry('of', 'PrepositionOf') add_entry('on', 'Preposition') add_entry('one', 'Cardinal') add_entry('other', 'Adjective') add_entry('part', 'CommonNoun') add_entry('people', 'CommonNoun') add_entry('person', 'CommonNoun') add_entry('place', 'CommonNoun') add_entry('same', 'Adjective') add_entry('say', 'IrregularVerbSay') add_entry('see', 'IrregularVerb') add_entry('short', 'Adjective') add_entry('side', 'CommonNoun') add_entry('small', 'Adjective') add_entry('some', 'IndefiniteQuantifier') add_entry('someone', 'IndefinitePronoun') add_entry('something', 'IndefinitePronoun') add_entry('than', 'PrepositionThan') add_entry('the', 'DefiniteArticle') add_entry('then', 'LinkingAdverb') add_entry('there', 'AdverbThere') add_entry('thing', 'CommonNoun') add_entry('think', 'IrregularVerbThink') add_entry('this', 'DemonstrativeDeterminer') add_entry('this', 'DemonstrativePronoun') add_entry('this one', 'DemonstrativePronoun') add_entry('time', 'CommonNoun') add_entry('to', 'Preposition') add_entry('touch', 'RegularVerb') add_entry('true', 'Adjective') add_entry('two', 'Cardinal') add_entry('very', 'DegreeAdverb') add_entry('want', 'RegularVerbWant') add_entry('what','ConjunctivePronoun') add_entry('when','SubordinatingConjunction') add_entry('who','RelativePronoun') add_entry('with','Preposition') add_entry('word', 'CommonNoun') add_entry('you', 'PersonalPronoun') # Punctuation signs... add_entry(':', 'Colon') add_entry(',', 'Comma') add_entry('.', 'Period') add_entry('"', 'Quote') end # module end # module end # defined?