File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ def edges(word: str, lang: str = "th"):
25
25
--a part of--> "artificial intelligence"
26
26
27
27
With this illustration, it shows relationships (represented as *Edge*)
28
- between the terms (represented as *Node*)
28
+ between the terms (represented as *Node*).
29
+
30
+ This function requires an internet connection to access the ConceptNet API.
31
+ Please use it considerately. It will timeout after 10 seconds.
29
32
30
33
:param str word: word to be sent to ConceptNet API
31
34
:param str lang: abbreviation of language (i.e. *th* for Thai, *en* for
@@ -107,5 +110,5 @@ def edges(word: str, lang: str = "th"):
107
110
# }, ...]
108
111
"""
109
112
110
- obj = requests .get (f"https://api.conceptnet.io/c/{ lang } /{ word } " ).json ()
113
+ obj = requests .get (f"https://api.conceptnet.io/c/{ lang } /{ word } " , timeout = 10 ).json ()
111
114
return obj ["edges" ]
You can’t perform that action at this time.
0 commit comments