-
Notifications
You must be signed in to change notification settings - Fork 8
/
examples.rb
55 lines (42 loc) · 1.79 KB
/
examples.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env ruby
# coding: utf-8
#require 'rubygems'
#require 'words'
require 'lib/words.rb'
if __FILE__ == $0
wordnet = Words::Wordnet.new #:tokyo
puts wordnet.connected?
wordnet.close!
puts wordnet.connected?
wordnet.open!
puts wordnet.connected?
puts wordnet
puts wordnet.find('squash racquet')
puts wordnet.find('bat')
puts wordnet.find('bat').available_pos.inspect
puts wordnet.find('bat').lemma
puts wordnet.find('bat').nouns?
puts wordnet.find('bat').synsets('noun')
puts wordnet.find('bat').noun_ids
puts wordnet.find('bat').synsets(:noun)[2].words.inspect
puts wordnet.find('bat').nouns.last.relations
wordnet.find('bat').synsets('noun').last.relations.each { |relation| puts relation.inspect }
puts wordnet.find('bat').synsets('noun').last.hyponyms?
puts wordnet.find('bat').synsets('noun').last.participle_of_verbs?
puts wordnet.find('bat').synsets('noun').last.relations(:hyponym)
puts wordnet.find('bat').synsets('noun').last.hyponyms?
puts wordnet.find('bat').synsets('noun').last.relations("~")
puts wordnet.find('bat').synsets('verb').last.inspect
puts wordnet.find('bat').synsets('verb').last.words.inspect
puts wordnet.find('bat').synsets('verb').last.words_with_lexical_ids.inspect
puts wordnet.find('bat').synsets('verb').first.lexical.inspect
puts wordnet.find('bat').synsets('verb').first.lexical_description
puts wordnet.find('jkashdfajkshfksjdhf')
if wordnet.evocations?
puts wordnet.find("broadcast").senses.first.evocations
puts wordnet.find("broadcast").senses.first.evocations.means
puts wordnet.find("broadcast").senses.first.evocations[1].inspect
puts wordnet.find("broadcast").senses.first.evocations[20][:destination].words
end
wordnet.close!
end