alessandro trinca tornidor commited on
Commit
91172b4
·
1 Parent(s): e0b1feb

feat: fix wrong assign in get_synsets_by_word_and_language()

Browse files
my_ghost_writer/thesaurus.py CHANGED
@@ -156,9 +156,9 @@ def get_synsets_by_word_and_language(word: str, lang: str = "eng") -> ResponseWo
156
  if has_types:
157
  obj["hasTypes"] = has_types
158
  if part_of:
159
- obj["partOf"]: part_of
160
  if has_parts:
161
- obj["hasParts"]: has_parts
162
  if antonyms:
163
  obj["antonyms"] = antonyms
164
  if derivation:
@@ -190,11 +190,3 @@ def get_synsets_by_word_and_language(word: str, lang: str = "eng") -> ResponseWo
190
  "word": word,
191
  "results": results
192
  }
193
-
194
-
195
- if __name__ == '__main__':
196
- res = {}
197
- for w in ["dog", "spider", "look", "tree"]:
198
- oo = get_synsets_by_word_and_language(w, lang="eng")
199
- res[w] = oo
200
- pass
 
156
  if has_types:
157
  obj["hasTypes"] = has_types
158
  if part_of:
159
+ obj["partOf"] = part_of
160
  if has_parts:
161
+ obj["hasParts"] = has_parts
162
  if antonyms:
163
  obj["antonyms"] = antonyms
164
  if derivation:
 
190
  "word": word,
191
  "results": results
192
  }
 
 
 
 
 
 
 
 
tests/events/expected_get_synsets_by_word_and_language_dog.json CHANGED
@@ -1 +1,195 @@
1
- {"word": "dog", "results": [{"definition": "a member of the genus Canis (probably descended from the common wolf) that has been domesticated by man since prehistoric times; occurs in many breeds", "synonyms": ["Canis familiaris", "domestic dog"], "typeOf": ["canid", "canine", "domestic animal", "domesticated animal"], "hasTypes": ["Belgian griffon", "Brussels griffon", "Great Pyrenees", "Leonberg", "Mexican hairless", "Newfoundland", "Newfoundland dog", "Welsh corgi", "barker", "basenji", "bow-wow", "carriage dog", "coach dog", "corgi", "cur", "dalmatian", "doggie", "doggy", "griffon", "hunting dog", "lapdog", "mongrel", "mutt", "pooch", "poodle", "poodle dog", "pug", "pug-dog", "puppy", "spitz", "toy", "toy dog", "working dog"]}, {"definition": "a dull unattractive unpleasant girl or woman", "synonyms": ["frump"], "typeOf": ["disagreeable woman", "unpleasant woman"], "derivation": ["frumpy"]}, {"definition": "informal term for a man", "typeOf": ["blighter", "bloke", "chap", "cuss", "fella", "feller", "fellow", "gent", "lad"]}, {"definition": "someone who is morally reprehensible", "synonyms": ["blackguard", "bounder", "cad", "heel", "hound"], "typeOf": ["scoundrel", "villain"], "hasTypes": ["perisher"], "derivation": ["blackguardly"]}, {"definition": "a smooth-textured sausage of minced beef or pork usually smoked; often served on a bread roll", "synonyms": ["frank", "frankfurter", "hot dog", "hotdog", "weenie", "wiener", "wienerwurst"], "typeOf": ["sausage"], "hasTypes": ["Vienna sausage"]}, {"definition": "a hinged catch that fits into a notch of a ratchet to move a wheel forward or prevent it from moving backward", "synonyms": ["click", "detent", "pawl"], "typeOf": ["catch", "stop"]}, {"definition": "metal supports for logs in a fireplace", "synonyms": ["andiron", "dog-iron", "firedog"], "typeOf": ["support"]}, {"definition": "go after with the intent to catch", "synonyms": ["chase", "chase after", "give chase", "go after", "tag", "tail", "track", "trail"], "typeOf": ["follow", "pursue"], "hasTypes": ["hound", "hunt", "quest", "run down", "trace", "tree"], "derivation": ["chase", "chaser", "tag", "tail", "tailing", "track", "tracker", "tracking", "trailing"]}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word": "dog",
3
+ "results": [
4
+ {
5
+ "definition": "a member of the genus Canis (probably descended from the common wolf) that has been domesticated by man since prehistoric times; occurs in many breeds",
6
+ "synonyms": [
7
+ "Canis familiaris",
8
+ "domestic dog"
9
+ ],
10
+ "typeOf": [
11
+ "canid",
12
+ "canine",
13
+ "domestic animal",
14
+ "domesticated animal"
15
+ ],
16
+ "hasTypes": [
17
+ "Belgian griffon",
18
+ "Brussels griffon",
19
+ "Great Pyrenees",
20
+ "Leonberg",
21
+ "Mexican hairless",
22
+ "Newfoundland",
23
+ "Newfoundland dog",
24
+ "Welsh corgi",
25
+ "barker",
26
+ "basenji",
27
+ "bow-wow",
28
+ "carriage dog",
29
+ "coach dog",
30
+ "corgi",
31
+ "cur",
32
+ "dalmatian",
33
+ "doggie",
34
+ "doggy",
35
+ "griffon",
36
+ "hunting dog",
37
+ "lapdog",
38
+ "mongrel",
39
+ "mutt",
40
+ "pooch",
41
+ "poodle",
42
+ "poodle dog",
43
+ "pug",
44
+ "pug-dog",
45
+ "puppy",
46
+ "spitz",
47
+ "toy",
48
+ "toy dog",
49
+ "working dog"
50
+ ],
51
+ "partOf": [
52
+ "Canis",
53
+ "genus Canis",
54
+ "pack"
55
+ ],
56
+ "hasParts": [
57
+ "flag"
58
+ ]
59
+ },
60
+ {
61
+ "definition": "a dull unattractive unpleasant girl or woman",
62
+ "synonyms": [
63
+ "frump"
64
+ ],
65
+ "typeOf": [
66
+ "disagreeable woman",
67
+ "unpleasant woman"
68
+ ],
69
+ "derivation": [
70
+ "frumpy"
71
+ ]
72
+ },
73
+ {
74
+ "definition": "informal term for a man",
75
+ "typeOf": [
76
+ "blighter",
77
+ "bloke",
78
+ "chap",
79
+ "cuss",
80
+ "fella",
81
+ "feller",
82
+ "fellow",
83
+ "gent",
84
+ "lad"
85
+ ]
86
+ },
87
+ {
88
+ "definition": "someone who is morally reprehensible",
89
+ "synonyms": [
90
+ "blackguard",
91
+ "bounder",
92
+ "cad",
93
+ "heel",
94
+ "hound"
95
+ ],
96
+ "typeOf": [
97
+ "scoundrel",
98
+ "villain"
99
+ ],
100
+ "hasTypes": [
101
+ "perisher"
102
+ ],
103
+ "derivation": [
104
+ "blackguardly"
105
+ ]
106
+ },
107
+ {
108
+ "definition": "a smooth-textured sausage of minced beef or pork usually smoked; often served on a bread roll",
109
+ "synonyms": [
110
+ "frank",
111
+ "frankfurter",
112
+ "hot dog",
113
+ "hotdog",
114
+ "weenie",
115
+ "wiener",
116
+ "wienerwurst"
117
+ ],
118
+ "typeOf": [
119
+ "sausage"
120
+ ],
121
+ "hasTypes": [
122
+ "Vienna sausage"
123
+ ],
124
+ "partOf": [
125
+ "hot dog",
126
+ "hotdog",
127
+ "red hot"
128
+ ]
129
+ },
130
+ {
131
+ "definition": "a hinged catch that fits into a notch of a ratchet to move a wheel forward or prevent it from moving backward",
132
+ "synonyms": [
133
+ "click",
134
+ "detent",
135
+ "pawl"
136
+ ],
137
+ "typeOf": [
138
+ "catch",
139
+ "stop"
140
+ ],
141
+ "partOf": [
142
+ "rachet",
143
+ "ratch",
144
+ "ratchet"
145
+ ]
146
+ },
147
+ {
148
+ "definition": "metal supports for logs in a fireplace",
149
+ "synonyms": [
150
+ "andiron",
151
+ "dog-iron",
152
+ "firedog"
153
+ ],
154
+ "typeOf": [
155
+ "support"
156
+ ]
157
+ },
158
+ {
159
+ "definition": "go after with the intent to catch",
160
+ "synonyms": [
161
+ "chase",
162
+ "chase after",
163
+ "give chase",
164
+ "go after",
165
+ "tag",
166
+ "tail",
167
+ "track",
168
+ "trail"
169
+ ],
170
+ "typeOf": [
171
+ "follow",
172
+ "pursue"
173
+ ],
174
+ "hasTypes": [
175
+ "hound",
176
+ "hunt",
177
+ "quest",
178
+ "run down",
179
+ "trace",
180
+ "tree"
181
+ ],
182
+ "derivation": [
183
+ "chase",
184
+ "chaser",
185
+ "tag",
186
+ "tail",
187
+ "tailing",
188
+ "track",
189
+ "tracker",
190
+ "tracking",
191
+ "trailing"
192
+ ]
193
+ }
194
+ ]
195
+ }
tests/events/expected_get_synsets_by_word_and_language_look.json CHANGED
@@ -1 +1,331 @@
1
- {"word": "look", "results": [{"definition": "the feelings expressed on a person's face", "synonyms": ["aspect", "expression", "face", "facial expression"], "typeOf": ["countenance", "visage"], "hasTypes": ["leer", "light", "spark", "sparkle", "twinkle"], "derivation": ["look"]}, {"definition": "the act of directing the eyes toward something and perceiving it visually", "synonyms": ["looking", "looking at"], "typeOf": ["perception", "sensing"], "hasTypes": ["coup d'oeil", "dekko", "evil eye", "glance", "glimpse", "lookout", "observance", "observation", "outlook", "peek", "peep", "rubber-necking", "scrutiny", "sight", "sightseeing", "squint", "stare", "survey", "view", "watching"], "derivation": ["look"]}, {"definition": "physical appearance", "typeOf": ["appearance", "visual aspect"], "derivation": ["look"]}, {"definition": "the general atmosphere of a place or situation and the effect that it has on people", "synonyms": ["feel", "feeling", "flavor", "flavour", "smell", "spirit", "tone"], "typeOf": ["ambiance", "ambience", "atmosphere"], "hasTypes": ["Hollywood", "Zeitgeist"], "derivation": ["feel", "look", "spirit", "spiritize"]}, {"definition": "perceive with attention; direct one's gaze towards", "hasTypes": ["admire", "consider", "eye", "eyeball", "gape", "gawk", "gawp", "gaze", "get a load", "give the eye", "give the glad eye", "give the once over", "glance", "glint", "gloat", "goggle", "have a look", "leer", "look around", "look away", "look back", "look backward", "ogle", "peek", "peep", "peer", "regard", "squint", "stare", "take a look"], "derivation": ["look", "looker"], "entails": ["see"]}, {"definition": "give a certain impression or have a certain outward aspect", "synonyms": ["appear", "seem"], "typeOf": ["be"], "hasTypes": ["beam", "come across", "cut", "feel", "gleam", "glint", "glisten", "glitter", "glow", "jump", "jump out", "leap out", "lift", "loom", "make", "pass off", "radiate", "rear", "rise", "shine", "sound", "stand out", "stick out"], "derivation": ["appearance", "look"]}, {"definition": "have a certain outward or facial expression", "typeOf": ["be"], "hasTypes": ["squint"], "derivation": ["look"]}, {"definition": "search or seek", "synonyms": ["search"], "typeOf": ["examine", "see"], "hasTypes": ["cruise", "horn in", "hunt", "intrude", "nose", "poke", "prospect", "pry"], "derivation": ["search", "searcher"]}, {"definition": "be oriented in a certain direction, often with respect to another reference point; be opposite to", "synonyms": ["face", "front"], "typeOf": ["lie"], "hasTypes": ["confront"], "antonyms": ["back"], "derivation": ["front", "frontage"], "verbGroups": ["face"]}, {"definition": "take charge of or deal with", "synonyms": ["attend", "see", "take care"], "typeOf": ["care", "give care"], "hasTypes": ["minister", "tend"], "derivation": ["attention"]}, {"definition": "convey by one's expression", "typeOf": ["convey"], "derivation": ["look"]}, {"definition": "look forward to the probable occurrence of", "synonyms": ["await", "expect", "wait"], "hasTypes": ["anticipate", "expect", "hang on", "hold on", "hold the line", "look for", "look forward", "look to"], "derivation": ["expectancy", "expectant", "expectation", "waiter"], "verbGroups": ["anticipate", "expect"]}, {"definition": "accord in appearance with", "typeOf": ["agree", "check", "correspond", "fit", "gibe", "jibe", "match", "tally"]}, {"definition": "have faith or confidence in", "synonyms": ["bank", "bet", "calculate", "count", "depend", "reckon", "rely", "swear"], "typeOf": ["trust"], "derivation": ["dependency", "reliance", "reliant"]}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word": "look",
3
+ "results": [
4
+ {
5
+ "definition": "the feelings expressed on a person's face",
6
+ "synonyms": [
7
+ "aspect",
8
+ "expression",
9
+ "face",
10
+ "facial expression"
11
+ ],
12
+ "typeOf": [
13
+ "countenance",
14
+ "visage"
15
+ ],
16
+ "hasTypes": [
17
+ "leer",
18
+ "light",
19
+ "spark",
20
+ "sparkle",
21
+ "twinkle"
22
+ ],
23
+ "derivation": [
24
+ "look"
25
+ ]
26
+ },
27
+ {
28
+ "definition": "the act of directing the eyes toward something and perceiving it visually",
29
+ "synonyms": [
30
+ "looking",
31
+ "looking at"
32
+ ],
33
+ "typeOf": [
34
+ "perception",
35
+ "sensing"
36
+ ],
37
+ "hasTypes": [
38
+ "coup d'oeil",
39
+ "dekko",
40
+ "evil eye",
41
+ "glance",
42
+ "glimpse",
43
+ "lookout",
44
+ "observance",
45
+ "observation",
46
+ "outlook",
47
+ "peek",
48
+ "peep",
49
+ "rubber-necking",
50
+ "scrutiny",
51
+ "sight",
52
+ "sightseeing",
53
+ "squint",
54
+ "stare",
55
+ "survey",
56
+ "view",
57
+ "watching"
58
+ ],
59
+ "derivation": [
60
+ "look"
61
+ ]
62
+ },
63
+ {
64
+ "definition": "physical appearance",
65
+ "typeOf": [
66
+ "appearance",
67
+ "visual aspect"
68
+ ],
69
+ "derivation": [
70
+ "look"
71
+ ]
72
+ },
73
+ {
74
+ "definition": "the general atmosphere of a place or situation and the effect that it has on people",
75
+ "synonyms": [
76
+ "feel",
77
+ "feeling",
78
+ "flavor",
79
+ "flavour",
80
+ "smell",
81
+ "spirit",
82
+ "tone"
83
+ ],
84
+ "typeOf": [
85
+ "ambiance",
86
+ "ambience",
87
+ "atmosphere"
88
+ ],
89
+ "hasTypes": [
90
+ "Hollywood",
91
+ "Zeitgeist"
92
+ ],
93
+ "derivation": [
94
+ "feel",
95
+ "look",
96
+ "spirit",
97
+ "spiritize"
98
+ ]
99
+ },
100
+ {
101
+ "definition": "perceive with attention; direct one's gaze towards",
102
+ "hasTypes": [
103
+ "admire",
104
+ "consider",
105
+ "eye",
106
+ "eyeball",
107
+ "gape",
108
+ "gawk",
109
+ "gawp",
110
+ "gaze",
111
+ "get a load",
112
+ "give the eye",
113
+ "give the glad eye",
114
+ "give the once over",
115
+ "glance",
116
+ "glint",
117
+ "gloat",
118
+ "goggle",
119
+ "have a look",
120
+ "leer",
121
+ "look around",
122
+ "look away",
123
+ "look back",
124
+ "look backward",
125
+ "ogle",
126
+ "peek",
127
+ "peep",
128
+ "peer",
129
+ "regard",
130
+ "squint",
131
+ "stare",
132
+ "take a look"
133
+ ],
134
+ "derivation": [
135
+ "look",
136
+ "looker"
137
+ ],
138
+ "entails": [
139
+ "see"
140
+ ]
141
+ },
142
+ {
143
+ "definition": "give a certain impression or have a certain outward aspect",
144
+ "synonyms": [
145
+ "appear",
146
+ "seem"
147
+ ],
148
+ "typeOf": [
149
+ "be"
150
+ ],
151
+ "hasTypes": [
152
+ "beam",
153
+ "come across",
154
+ "cut",
155
+ "feel",
156
+ "gleam",
157
+ "glint",
158
+ "glisten",
159
+ "glitter",
160
+ "glow",
161
+ "jump",
162
+ "jump out",
163
+ "leap out",
164
+ "lift",
165
+ "loom",
166
+ "make",
167
+ "pass off",
168
+ "radiate",
169
+ "rear",
170
+ "rise",
171
+ "shine",
172
+ "sound",
173
+ "stand out",
174
+ "stick out"
175
+ ],
176
+ "derivation": [
177
+ "appearance",
178
+ "look"
179
+ ]
180
+ },
181
+ {
182
+ "definition": "have a certain outward or facial expression",
183
+ "typeOf": [
184
+ "be"
185
+ ],
186
+ "hasTypes": [
187
+ "squint"
188
+ ],
189
+ "derivation": [
190
+ "look"
191
+ ]
192
+ },
193
+ {
194
+ "definition": "search or seek",
195
+ "synonyms": [
196
+ "search"
197
+ ],
198
+ "typeOf": [
199
+ "examine",
200
+ "see"
201
+ ],
202
+ "hasTypes": [
203
+ "cruise",
204
+ "horn in",
205
+ "hunt",
206
+ "intrude",
207
+ "nose",
208
+ "poke",
209
+ "prospect",
210
+ "pry"
211
+ ],
212
+ "derivation": [
213
+ "search",
214
+ "searcher"
215
+ ]
216
+ },
217
+ {
218
+ "definition": "be oriented in a certain direction, often with respect to another reference point; be opposite to",
219
+ "synonyms": [
220
+ "face",
221
+ "front"
222
+ ],
223
+ "typeOf": [
224
+ "lie"
225
+ ],
226
+ "hasTypes": [
227
+ "confront"
228
+ ],
229
+ "antonyms": [
230
+ "back"
231
+ ],
232
+ "derivation": [
233
+ "front",
234
+ "frontage"
235
+ ],
236
+ "verbGroups": [
237
+ "face"
238
+ ]
239
+ },
240
+ {
241
+ "definition": "take charge of or deal with",
242
+ "synonyms": [
243
+ "attend",
244
+ "see",
245
+ "take care"
246
+ ],
247
+ "typeOf": [
248
+ "care",
249
+ "give care"
250
+ ],
251
+ "hasTypes": [
252
+ "minister",
253
+ "tend"
254
+ ],
255
+ "derivation": [
256
+ "attention"
257
+ ]
258
+ },
259
+ {
260
+ "definition": "convey by one's expression",
261
+ "typeOf": [
262
+ "convey"
263
+ ],
264
+ "derivation": [
265
+ "look"
266
+ ]
267
+ },
268
+ {
269
+ "definition": "look forward to the probable occurrence of",
270
+ "synonyms": [
271
+ "await",
272
+ "expect",
273
+ "wait"
274
+ ],
275
+ "hasTypes": [
276
+ "anticipate",
277
+ "expect",
278
+ "hang on",
279
+ "hold on",
280
+ "hold the line",
281
+ "look for",
282
+ "look forward",
283
+ "look to"
284
+ ],
285
+ "derivation": [
286
+ "expectancy",
287
+ "expectant",
288
+ "expectation",
289
+ "waiter"
290
+ ],
291
+ "verbGroups": [
292
+ "anticipate",
293
+ "expect"
294
+ ]
295
+ },
296
+ {
297
+ "definition": "accord in appearance with",
298
+ "typeOf": [
299
+ "agree",
300
+ "check",
301
+ "correspond",
302
+ "fit",
303
+ "gibe",
304
+ "jibe",
305
+ "match",
306
+ "tally"
307
+ ]
308
+ },
309
+ {
310
+ "definition": "have faith or confidence in",
311
+ "synonyms": [
312
+ "bank",
313
+ "bet",
314
+ "calculate",
315
+ "count",
316
+ "depend",
317
+ "reckon",
318
+ "rely",
319
+ "swear"
320
+ ],
321
+ "typeOf": [
322
+ "trust"
323
+ ],
324
+ "derivation": [
325
+ "dependency",
326
+ "reliance",
327
+ "reliant"
328
+ ]
329
+ }
330
+ ]
331
+ }
tests/events/expected_get_synsets_by_word_and_language_power.json CHANGED
@@ -1 +1,266 @@
1
- {"word": "power", "results": [{"definition": "possession of controlling influence", "synonyms": ["powerfulness"], "typeOf": ["quality"], "hasTypes": ["chokehold", "control", "discretion", "disposal", "effectiveness", "effectivity", "effectuality", "effectualness", "free will", "influence", "interest", "interestingness", "irresistibility", "irresistibleness", "jurisdiction", "legal power", "persuasiveness", "potency", "preponderance", "puissance", "repellant", "repellent", "stranglehold", "strength", "sway", "throttlehold", "valence", "valency", "veto"], "antonyms": ["powerlessness"], "derivation": ["powerful"]}, {"definition": "(physics) the rate of doing work; measured in watts (= joules/second)", "typeOf": ["physical phenomenon"], "hasTypes": ["electric power", "electrical power", "waterpower", "wattage"], "derivation": ["power"], "inCategory": ["natural philosophy", "physics"]}, {"definition": "possession of the qualities (especially mental qualities) required to do something or get something done", "synonyms": ["ability"], "typeOf": ["cognition", "knowledge", "noesis"], "hasTypes": ["accomplishment", "acquirement", "acquisition", "aptitude", "attainment", "bilingualism", "capacity", "creative thinking", "creativeness", "creativity", "faculty", "hand", "intelligence", "know-how", "leadership", "mental ability", "mental faculty", "module", "originality", "science", "skill", "superior skill"], "antonyms": ["inability"], "derivation": ["able"]}, {"definition": "(of a government or government official) holding an office means being in power", "synonyms": ["office"], "typeOf": ["state"], "hasTypes": ["executive clemency", "war power"], "derivation": ["official", "officiate"], "inCategory": ["administration", "governance", "governing", "government", "government activity"]}, {"definition": "one possessing or exercising power or influence or authority", "synonyms": ["force"], "typeOf": ["causal agency", "causal agent", "cause"], "hasTypes": ["Moloch", "influence", "juggernaut", "steamroller"], "derivation": ["force"]}, {"definition": "a mathematical notation indicating the number of times a quantity is multiplied by itself", "synonyms": ["exponent", "index"], "typeOf": ["mathematical notation"], "hasTypes": ["degree", "log", "logarithm"], "derivation": ["exponential"]}, {"definition": "physical strength", "synonyms": ["might", "mightiness"], "typeOf": ["strength"], "derivation": ["mighty"]}, {"definition": "a state powerful enough to influence events throughout the world", "synonyms": ["great power", "major power", "superpower", "world power"], "typeOf": ["body politic", "commonwealth", "country", "land", "nation", "res publica", "state"], "hasTypes": ["hegemon"]}, {"definition": "energy made available by the flow of electric charge through a conductor", "synonyms": ["electrical energy", "electricity"], "typeOf": ["energy", "free energy"], "hasTypes": ["AC", "DC", "alternating current", "alternating electric current", "direct current", "direct electric current", "signal"], "derivation": ["electric", "electrify"]}, {"definition": "a very wealthy or powerful businessman", "synonyms": ["baron", "big businessman", "business leader", "king", "magnate", "mogul", "top executive", "tycoon"], "typeOf": ["businessman", "man of affairs"], "hasTypes": ["oil tycoon"]}, {"definition": "supply the force or power for the functioning of", "typeOf": ["cater", "ply", "provide", "supply"], "hasTypes": ["drive"], "derivation": ["power"]}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word": "power",
3
+ "results": [
4
+ {
5
+ "definition": "possession of controlling influence",
6
+ "synonyms": [
7
+ "powerfulness"
8
+ ],
9
+ "typeOf": [
10
+ "quality"
11
+ ],
12
+ "hasTypes": [
13
+ "chokehold",
14
+ "control",
15
+ "discretion",
16
+ "disposal",
17
+ "effectiveness",
18
+ "effectivity",
19
+ "effectuality",
20
+ "effectualness",
21
+ "free will",
22
+ "influence",
23
+ "interest",
24
+ "interestingness",
25
+ "irresistibility",
26
+ "irresistibleness",
27
+ "jurisdiction",
28
+ "legal power",
29
+ "persuasiveness",
30
+ "potency",
31
+ "preponderance",
32
+ "puissance",
33
+ "repellant",
34
+ "repellent",
35
+ "stranglehold",
36
+ "strength",
37
+ "sway",
38
+ "throttlehold",
39
+ "valence",
40
+ "valency",
41
+ "veto"
42
+ ],
43
+ "antonyms": [
44
+ "powerlessness"
45
+ ],
46
+ "derivation": [
47
+ "powerful"
48
+ ]
49
+ },
50
+ {
51
+ "definition": "(physics) the rate of doing work; measured in watts (= joules/second)",
52
+ "typeOf": [
53
+ "physical phenomenon"
54
+ ],
55
+ "hasTypes": [
56
+ "electric power",
57
+ "electrical power",
58
+ "waterpower",
59
+ "wattage"
60
+ ],
61
+ "derivation": [
62
+ "power"
63
+ ],
64
+ "inCategory": [
65
+ "natural philosophy",
66
+ "physics"
67
+ ]
68
+ },
69
+ {
70
+ "definition": "possession of the qualities (especially mental qualities) required to do something or get something done",
71
+ "synonyms": [
72
+ "ability"
73
+ ],
74
+ "typeOf": [
75
+ "cognition",
76
+ "knowledge",
77
+ "noesis"
78
+ ],
79
+ "hasTypes": [
80
+ "accomplishment",
81
+ "acquirement",
82
+ "acquisition",
83
+ "aptitude",
84
+ "attainment",
85
+ "bilingualism",
86
+ "capacity",
87
+ "creative thinking",
88
+ "creativeness",
89
+ "creativity",
90
+ "faculty",
91
+ "hand",
92
+ "intelligence",
93
+ "know-how",
94
+ "leadership",
95
+ "mental ability",
96
+ "mental faculty",
97
+ "module",
98
+ "originality",
99
+ "science",
100
+ "skill",
101
+ "superior skill"
102
+ ],
103
+ "antonyms": [
104
+ "inability"
105
+ ],
106
+ "derivation": [
107
+ "able"
108
+ ]
109
+ },
110
+ {
111
+ "definition": "(of a government or government official) holding an office means being in power",
112
+ "synonyms": [
113
+ "office"
114
+ ],
115
+ "typeOf": [
116
+ "state"
117
+ ],
118
+ "hasTypes": [
119
+ "executive clemency",
120
+ "war power"
121
+ ],
122
+ "derivation": [
123
+ "official",
124
+ "officiate"
125
+ ],
126
+ "inCategory": [
127
+ "administration",
128
+ "governance",
129
+ "governing",
130
+ "government",
131
+ "government activity"
132
+ ]
133
+ },
134
+ {
135
+ "definition": "one possessing or exercising power or influence or authority",
136
+ "synonyms": [
137
+ "force"
138
+ ],
139
+ "typeOf": [
140
+ "causal agency",
141
+ "causal agent",
142
+ "cause"
143
+ ],
144
+ "hasTypes": [
145
+ "Moloch",
146
+ "influence",
147
+ "juggernaut",
148
+ "steamroller"
149
+ ],
150
+ "derivation": [
151
+ "force"
152
+ ]
153
+ },
154
+ {
155
+ "definition": "a mathematical notation indicating the number of times a quantity is multiplied by itself",
156
+ "synonyms": [
157
+ "exponent",
158
+ "index"
159
+ ],
160
+ "typeOf": [
161
+ "mathematical notation"
162
+ ],
163
+ "hasTypes": [
164
+ "degree",
165
+ "log",
166
+ "logarithm"
167
+ ],
168
+ "derivation": [
169
+ "exponential"
170
+ ]
171
+ },
172
+ {
173
+ "definition": "physical strength",
174
+ "synonyms": [
175
+ "might",
176
+ "mightiness"
177
+ ],
178
+ "typeOf": [
179
+ "strength"
180
+ ],
181
+ "derivation": [
182
+ "mighty"
183
+ ]
184
+ },
185
+ {
186
+ "definition": "a state powerful enough to influence events throughout the world",
187
+ "synonyms": [
188
+ "great power",
189
+ "major power",
190
+ "superpower",
191
+ "world power"
192
+ ],
193
+ "typeOf": [
194
+ "body politic",
195
+ "commonwealth",
196
+ "country",
197
+ "land",
198
+ "nation",
199
+ "res publica",
200
+ "state"
201
+ ],
202
+ "hasTypes": [
203
+ "hegemon"
204
+ ]
205
+ },
206
+ {
207
+ "definition": "energy made available by the flow of electric charge through a conductor",
208
+ "synonyms": [
209
+ "electrical energy",
210
+ "electricity"
211
+ ],
212
+ "typeOf": [
213
+ "energy",
214
+ "free energy"
215
+ ],
216
+ "hasTypes": [
217
+ "AC",
218
+ "DC",
219
+ "alternating current",
220
+ "alternating electric current",
221
+ "direct current",
222
+ "direct electric current",
223
+ "signal"
224
+ ],
225
+ "derivation": [
226
+ "electric",
227
+ "electrify"
228
+ ]
229
+ },
230
+ {
231
+ "definition": "a very wealthy or powerful businessman",
232
+ "synonyms": [
233
+ "baron",
234
+ "big businessman",
235
+ "business leader",
236
+ "king",
237
+ "magnate",
238
+ "mogul",
239
+ "top executive",
240
+ "tycoon"
241
+ ],
242
+ "typeOf": [
243
+ "businessman",
244
+ "man of affairs"
245
+ ],
246
+ "hasTypes": [
247
+ "oil tycoon"
248
+ ]
249
+ },
250
+ {
251
+ "definition": "supply the force or power for the functioning of",
252
+ "typeOf": [
253
+ "cater",
254
+ "ply",
255
+ "provide",
256
+ "supply"
257
+ ],
258
+ "hasTypes": [
259
+ "drive"
260
+ ],
261
+ "derivation": [
262
+ "power"
263
+ ]
264
+ }
265
+ ]
266
+ }
tests/events/expected_get_synsets_by_word_and_language_term.json CHANGED
@@ -1 +1,127 @@
1
- {"word": "term", "results": [{"definition": "a word or expression used for some particular thing", "typeOf": ["word"], "hasTypes": ["referent"], "derivation": ["term"]}, {"definition": "a limited period of time", "typeOf": ["period", "period of time", "time period"], "hasTypes": ["academic session", "academic term", "incumbency", "prison term", "school term", "sentence", "session", "tenure", "term of office", "time"]}, {"definition": "(usually plural) a statement of what is required as part of an agreement", "synonyms": ["condition", "strings"], "typeOf": ["statement"], "derivation": ["condition"], "usageOf": ["plural", "plural form"]}, {"definition": "any distinct quantity contained in a polynomial", "typeOf": ["quantity"]}, {"definition": "one of the substantive phrases in a logical proposition", "typeOf": ["constituent", "grammatical constituent"], "hasTypes": ["categorem", "categoreme", "major term", "middle term", "minor term", "predicate", "referent", "relatum", "subject"]}, {"definition": "the end of gestation or point at which birth is imminent", "synonyms": ["full term"], "typeOf": ["point", "point in time"]}, {"definition": "(architecture) a statue or a human bust or an animal carved out of the top of a square pillar; originally used as a boundary marker in ancient Rome", "synonyms": ["terminal figure", "terminus"], "typeOf": ["statue"], "inCategory": ["architecture"]}, {"definition": "name formally or designate with a term", "typeOf": ["be known as", "call", "know as", "name"], "derivation": ["term"]}]}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word": "term",
3
+ "results": [
4
+ {
5
+ "definition": "a word or expression used for some particular thing",
6
+ "typeOf": [
7
+ "word"
8
+ ],
9
+ "hasTypes": [
10
+ "referent"
11
+ ],
12
+ "derivation": [
13
+ "term"
14
+ ]
15
+ },
16
+ {
17
+ "definition": "a limited period of time",
18
+ "typeOf": [
19
+ "period",
20
+ "period of time",
21
+ "time period"
22
+ ],
23
+ "hasTypes": [
24
+ "academic session",
25
+ "academic term",
26
+ "incumbency",
27
+ "prison term",
28
+ "school term",
29
+ "sentence",
30
+ "session",
31
+ "tenure",
32
+ "term of office",
33
+ "time"
34
+ ],
35
+ "hasParts": [
36
+ "midterm"
37
+ ]
38
+ },
39
+ {
40
+ "definition": "(usually plural) a statement of what is required as part of an agreement",
41
+ "synonyms": [
42
+ "condition",
43
+ "strings"
44
+ ],
45
+ "typeOf": [
46
+ "statement"
47
+ ],
48
+ "partOf": [
49
+ "agreement",
50
+ "understanding"
51
+ ],
52
+ "derivation": [
53
+ "condition"
54
+ ],
55
+ "usageOf": [
56
+ "plural",
57
+ "plural form"
58
+ ]
59
+ },
60
+ {
61
+ "definition": "any distinct quantity contained in a polynomial",
62
+ "typeOf": [
63
+ "quantity"
64
+ ]
65
+ },
66
+ {
67
+ "definition": "one of the substantive phrases in a logical proposition",
68
+ "typeOf": [
69
+ "constituent",
70
+ "grammatical constituent"
71
+ ],
72
+ "hasTypes": [
73
+ "categorem",
74
+ "categoreme",
75
+ "major term",
76
+ "middle term",
77
+ "minor term",
78
+ "predicate",
79
+ "referent",
80
+ "relatum",
81
+ "subject"
82
+ ],
83
+ "partOf": [
84
+ "proposition"
85
+ ]
86
+ },
87
+ {
88
+ "definition": "the end of gestation or point at which birth is imminent",
89
+ "synonyms": [
90
+ "full term"
91
+ ],
92
+ "typeOf": [
93
+ "point",
94
+ "point in time"
95
+ ],
96
+ "partOf": [
97
+ "gestation",
98
+ "gestation period"
99
+ ]
100
+ },
101
+ {
102
+ "definition": "(architecture) a statue or a human bust or an animal carved out of the top of a square pillar; originally used as a boundary marker in ancient Rome",
103
+ "synonyms": [
104
+ "terminal figure",
105
+ "terminus"
106
+ ],
107
+ "typeOf": [
108
+ "statue"
109
+ ],
110
+ "inCategory": [
111
+ "architecture"
112
+ ]
113
+ },
114
+ {
115
+ "definition": "name formally or designate with a term",
116
+ "typeOf": [
117
+ "be known as",
118
+ "call",
119
+ "know as",
120
+ "name"
121
+ ],
122
+ "derivation": [
123
+ "term"
124
+ ]
125
+ }
126
+ ]
127
+ }
tests/test_thesaurus_wordnet.py CHANGED
@@ -25,7 +25,7 @@ def assert_get_synsets_by_word_and_language(cls, q):
25
  for s in v:
26
  cls.assertIsInstance(s, str)
27
  with open(EVENTS_FOLDER / f"expected_get_synsets_by_word_and_language_{q}.json", "r") as src:
28
- # json.dump(response, src)
29
  expected_response = json.load(src)
30
  cls.assertEqual(response, expected_response)
31
 
@@ -47,3 +47,7 @@ class TestThesaurusWordnet(unittest.TestCase):
47
  assert_get_synsets_by_word_and_language(self, "look")
48
  assert_get_synsets_by_word_and_language(self, "power")
49
  assert_get_synsets_by_word_and_language(self, "term")
 
 
 
 
 
25
  for s in v:
26
  cls.assertIsInstance(s, str)
27
  with open(EVENTS_FOLDER / f"expected_get_synsets_by_word_and_language_{q}.json", "r") as src:
28
+ # json.dump(response, src, indent=4)
29
  expected_response = json.load(src)
30
  cls.assertEqual(response, expected_response)
31
 
 
47
  assert_get_synsets_by_word_and_language(self, "look")
48
  assert_get_synsets_by_word_and_language(self, "power")
49
  assert_get_synsets_by_word_and_language(self, "term")
50
+
51
+
52
+ if __name__ == '__main__':
53
+ unittest.main()