Class: Moby::PartsOfSpeech

Inherits:
Base
  • Object
show all
Defined in:
lib/moby/parts_of_speech.rb

Instance Method Summary (collapse)

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})

Returns:

  • (Boolean)


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, options = {:type => :all})
  case options[: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(options = {:type => :all})
  case options[: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