Sha256: 09ce4ebe0d4b803fa914b9323ec364e51dba079e9ec440d7430913c0ef2422ec
Contents?: true
Size: 530 Bytes
Versions: 1
Compression:
Stored size: 530 Bytes
Contents
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
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
werd-0.0.2 | lib/werd/pos_filter.rb |