=
commited on
Commit
·
bddd8be
1
Parent(s):
7f8aad3
added check on detect function
Browse files
deep_translator/detection.py
CHANGED
|
@@ -9,6 +9,8 @@ def detect_language(text, api_key=None):
|
|
| 9 |
if not api_key:
|
| 10 |
raise Exception("you need to get an API_KEY for this to work. "
|
| 11 |
"Get one for free here: https://detectlanguage.com/documentation")
|
|
|
|
|
|
|
| 12 |
|
| 13 |
else:
|
| 14 |
headers = config['headers']
|
|
|
|
| 9 |
if not api_key:
|
| 10 |
raise Exception("you need to get an API_KEY for this to work. "
|
| 11 |
"Get one for free here: https://detectlanguage.com/documentation")
|
| 12 |
+
if not text:
|
| 13 |
+
raise Exception("Please provide an input text")
|
| 14 |
|
| 15 |
else:
|
| 16 |
headers = config['headers']
|