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"):
2525 --a part of--> "artificial intelligence"
2626
2727 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.
2932
3033 :param str word: word to be sent to ConceptNet API
3134 :param str lang: abbreviation of language (i.e. *th* for Thai, *en* for
@@ -107,5 +110,5 @@ def edges(word: str, lang: str = "th"):
107110 # }, ...]
108111 """
109112
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 ()
111114 return obj ["edges" ]
You can’t perform that action at this time.
0 commit comments