3
3
from ..Utils .LogMaster .log_init import MainLogger
4
4
5
5
6
+ class ClassDeprecated (Exception ):
7
+ pass
8
+
9
+
6
10
class UrbanDictionary ():
7
11
def __init__ (self , config ):
8
12
"""Initialize the Urban Dictionary API.
9
13
:param config: The config file(config.json).
10
14
"""
11
15
16
+ raise ClassDeprecated ("This class is deprecated" )
17
+
12
18
root_log = MainLogger (config )
13
19
self .log = root_log .StandardLogger ("UrbanDictionary" )
14
20
@@ -23,7 +29,7 @@ def define(self, word):
23
29
querystring = {"term" : word }
24
30
25
31
headers = {
26
- "X-RapidAPI-Key" : "ccb24b8108msh0b3a5c1ef1265b7p197610jsna515c20cf465 " ,
32
+ "X-RapidAPI-Key" : "xxx " ,
27
33
"X-RapidAPI-Host" : "mashape-community-urban-dictionary.p.rapidapi.com"
28
34
}
29
35
@@ -89,14 +95,13 @@ def __init__(self, config):
89
95
root_log = MainLogger (config )
90
96
self .log = root_log .StandardLogger ("FullDictionarySearch" )
91
97
92
- self .urban = UrbanDictionary (config )
93
98
self .dictdev = DicitonaryAPIDev (config )
94
99
95
100
def define (self , word ):
96
101
definition = self .dictdev .define (word )
97
102
98
103
if definition == "No definition found" :
99
- self .log .info ("No definition found in DictionaryAPI.dev. Trying UrbanDictionary... " )
100
- definition = self . urban . define ( word )
104
+ self .log .info ("No definition found in DictionaryAPI.dev." )
105
+ definition = None
101
106
102
107
return definition
0 commit comments