-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.py
executable file
·62 lines (51 loc) · 3.04 KB
/
example.py
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
56
57
58
59
60
61
#!/usr/bin/env python
#####################################
#####################################
# Ruben Izquierdo Bevia
# VU University of Amsterdam
# ruben.izquierdobevia@vu.nl
# rubensanvi@gmail.com
# http://rubenizquierdobevia.com/
# Version 1.0
#####################################
#####################################
from semantic_class_manager import *
if __name__ == '__main__':
a = BLC(0,'all')
print 'wn30 00021939', a.get_classes_for_synset_pos('00021939','n','30')
print 'wn21 00020846', a.get_classes_for_synset_pos('00020846','n','21')
print 'wn30 jimmy%2:35:00::', a.get_classes_for_lexkey('jimmy%2:35:00::','30')
print 'wn30 artifact%1:03:00::', a.get_classes_for_lexkey('artifact%1:03:00::', '30')
print 'wn21 artefact%1:03:00::', a.get_classes_for_lexkey('artifact%1:03:00::', '21')
print 'Classes for house.n', a.get_classes_for_lemma_pos('house', 'n')
print 'Classes for guitar.n', a.get_classes_for_lemma_pos('guitar', 'n')
wnd_obj = WND()
print '#'*20
print 'WND with no hierarchy'
print 'wn20 00002287-a', wnd_obj.get_classes_for_synset_pos('00002287','a')
print 'wn20 00012748-n', wnd_obj.get_classes_for_synset_pos('00012748', 'n')
print 'wn21 00015024-n', wnd_obj.get_classes_for_synset_pos('00015024', 'n', '21')
print 'wn20 acoustic_guitar%1:06:00::', wnd_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::')
print 'wn16 acoustic_guitar%1:06:00::', wnd_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::','16')
print 'Classes for house.n', wnd_obj.get_classes_for_lemma_pos('house', 'n')
print 'Classes for guitar.n', wnd_obj.get_classes_for_lemma_pos('guitar', 'n')
wnd_obj = WND(hierarchy=True)
print '#'*20
print 'WND with hierarchy'
print 'wn20 00002287-a', wnd_obj.get_classes_for_synset_pos('00002287','a')
print 'wn20 00012748-n', wnd_obj.get_classes_for_synset_pos('00012748', 'n')
print 'wn21 00015024-n', wnd_obj.get_classes_for_synset_pos('00015024', 'n', '21')
print 'wn20 acoustic_guitar%1:06:00::', wnd_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::')
print 'wn16 acoustic_guitar%1:06:00::', wnd_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::','16')
print 'Classes for house.n', wnd_obj.get_classes_for_lemma_pos('house', 'n')
print 'Classes for guitar.n', wnd_obj.get_classes_for_lemma_pos('guitar', 'n')
ss_obj = SuperSense()
print '#'*20
print 'SuperSense'
print 'wn20 00002287-a', ss_obj.get_classes_for_synset_pos('00002287','a', '20')
print 'wn20 00012748-n', ss_obj.get_classes_for_synset_pos('00012748', 'n', '20')
print 'wn21 00015024-n', ss_obj.get_classes_for_synset_pos('00015024', 'n', '21')
print 'wn20 acoustic_guitar%1:06:00::', ss_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::')
print 'wn16 acoustic_guitar%1:06:00::', ss_obj.get_classes_for_lexkey('acoustic_guitar%1:06:00::','16')
print 'Classes for house.n', ss_obj.get_classes_for_lemma_pos('house', 'n')
print 'Classes for guitar.n', ss_obj.get_classes_for_lemma_pos('guitar', 'n')