Class: Moby::PartsOfSpeech
Instance Method Summary (collapse)
- - (Object) find(word)
- - (Boolean) verb?(word, options = {:type => :all})
- - (Object) verbs(options = {:type => :all})
Instance Method Details
- (Object) find(word)
3 4 5 6 7 8 9 |
# File 'lib/moby/parts_of_speech.rb', line 3 def find(word) { :word => word, :found => pos.has_key?(word), :code => pos_code(word), :pos => pos_breakdown(word) } end |
- (Boolean) verb?(word, options = {:type => :all})
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/moby/parts_of_speech.rb', line 37 def verb?(word, = {:type => :all}) case [:type] when :all pos?(word, :verb_usu_participle) || pos?(word, :verb_transitive) || pos?(word, :verb_intransitive) when :usu pos?(word, :verb_usu_participle) when :transitive pos?(word, :verb_transitive) when :intransitive pos?(word, :verb_intransitive) end end |
- (Object) verbs(options = {:type => :all})
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/moby/parts_of_speech.rb', line 22 def verbs( = {:type => :all}) case [:type] when :all words(:verb_usu_participle) + words(:verb_transitive) + words(:verb_intransitive) when :usu words(:verb_usu_participle) when :transitive words(:verb_transitive) when :intransitive words(:verb_intransitive) end end |