module Werd class PosFilter include Contracts Contract WordList => WordList def self.filter(wordlist) pos = Moby::PartsOfSpeech.new wordlist.select do |row| word = pos.find(row.first)[:pos] next(false) if word.include?(:pronoun) next(false) if word.include?(:definite_article) next(false) if word.include?(:preposition) next(false) if word.include?(:conjunction) next(false) if word.include?(:verb_usu_participle) true end end end end