aboutsummaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 012f8bfc..f6a98677 100644
--- a/utils.py
+++ b/utils.py
@@ -27,6 +27,7 @@ def detect_language(text):
Detect the language of a text.
English, French or other (not detected).
"""
+ text = text.strip()
try:
text_stream = streams.Stream(StringIO(text))
lang = langdet.LanguageDetector.detect(text_stream)
bgstack15