Sha256: cc69e90849379b874f8898cc80b2684912aefc9c71e37dbccda19a40aaa0bffd

Contents?: true

Size: 934 Bytes

Versions: 1

Compression:

Stored size: 934 Bytes

Contents

require_relative '../wclasses/all_word_classes'
require_relative 'lexicon'

module Zenlish
  module Lex
    module EmptyLexiconFactory
      def create_empty_lexicon()
        lexicon = Lexicon.new

        add_word_classes(lexicon)
        add_punctuation(lexicon)
        lexicon
      end

      private

      def add_word_classes(aLexicon)
        aLexicon.add_terminal(WClasses::CommonNoun.new)
        aLexicon.add_terminal(WClasses::ProperNoun.new)
        aLexicon.add_terminal(WClasses::IrregularVerb.new)
        aLexicon.add_terminal(WClasses::Adjective.new)
        aLexicon.add_terminal(WClasses::DefiniteArticle.new)
        aLexicon.add_terminal(WClasses::DemonstrativeDeterminer.new)
        aLexicon.add_terminal(WClasses::IndefinitePronoun.new)
      end

      def add_punctuation(aLexicon)
        aLexicon.add_terminal(Rley::Syntax::Terminal.new('Period'))
      end
    end # module
  end # module
end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zenlish-0.1.0 lib/zenlish/lex/empty_lexicon_factory.rb