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', 'FrontingQuantifier') add_entry('and', 'Coordinator') add_entry('animal', 'CommonNoun') 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', 'Adjective') add_entry('before', 'SubordinatingConjunction') add_entry('belong', 'RegularVerb') add_entry('below', 'Preposition') add_entry('big', 'Adjective') add_entry('body', 'CommonNoun') add_entry('but', 'Coordinator') add_entry('can', 'ModalVerbCan') add_entry('cause', 'RegularVerb') add_entry('die', 'RegularVerb') add_entry('do', 'AuxiliaryDo') add_entry('do', 'IrregularVerbDo') add_entry('each', 'DistributiveDeterminer') add_entry('false', 'Adjective') add_entry('far', 'Adverb') add_entry('far from', 'Preposition') add_entry('feel', 'IrregularLinkingVerb') add_entry('for', 'Preposition') add_entry('from', 'Preposition') add_entry('good', 'Adjective') add_entry('have', 'IrregularVerbHave') add_entry('happen', 'RegularVerb') add_entry('hear', 'IrregularLinkingVerb') add_entry('here', 'Adverb') add_entry('here', 'CommonNoun') # from here (works as a pronoun of a place) add_entry('I', 'PersonalPronoun') add_entry('if', 'SubordinatingConjunction') add_entry('in', 'Preposition') add_entry('inside', 'Preposition') add_entry('it', 'PersonalPronoun') add_entry('its', 'PossessiveDeterminer') add_entry('kind', 'CommonNoun') add_entry('know', 'IrregularVerbKnow') add_entry('like', 'Preposition') add_entry('live', 'RegularVerb') add_entry('living', 'Adjective') add_entry('long', 'Adjective') add_entry('many', 'Quantifier') add_entry('maybe', 'AdverbMaybe') 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('my', 'PossessiveDeterminer') add_entry('near', 'Preposition') add_entry('near to', 'Preposition') add_entry('now', 'Adverb') add_entry('now', 'CommonNoun') add_entry('not', 'AdverbNot') add_entry('of', 'PrepositionOf') add_entry('on', 'Preposition') add_entry('one', 'Adjective') add_entry('one', 'Cardinal') add_entry('one', 'IndefinitePronoun') add_entry('or', 'Coordinator') 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', 'Quantifier') add_entry('someone', 'IndefinitePronoun') add_entry('something', 'IndefinitePronoun') add_entry('than', 'PrepositionThan') add_entry('that', 'RelativePronoun') add_entry('the', 'DefiniteArticle') add_entry('them', 'PersonalPronoun') add_entry('then', 'LinkingAdverb') add_entry('their', 'PossessiveDeterminer') add_entry('there', 'ExistentialThere') add_entry('they', 'PersonalPronoun') 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('two', 'IndefinitePronoun') add_entry('use', 'RegularVerb') 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') add_entry('your', 'PossessiveDeterminer') # Punctuation signs... add_entry(':', 'Colon') add_entry(',', 'Comma') add_entry('.', 'Period') add_entry('"', 'Quote') end # module end # module end # defined?