Mimino666 / langdetect

Port of Google's language-detection library to Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

langdetect returns IndexError rather than LangDetectException

MaxAwan opened this issue · comments

scores = langdetect.detect_langs(text)

File "../venv/lib/python3.7/site-packages/langdetect/detector_factory.py", line 116, in detect_langs
detector.append(text)
File "../venv/lib/python3.7/site-packages/langdetect/detector.py", line 106, in append
text = NGram.normalize_vi(text)
File "../venv/lib/python3.7/site-packages/langdetect/utils/ngram.py", line 108, in normalize_vi
return cls.ALPHABET_WITH_DMARK.sub(repl, text)
File "../venv/lib/python3.7/site-packages/langdetect/utils/ngram.py", line 107, in repl
return cls.NORMALIZED_VI_CHARS[dmark][alphabet]
IndexError: list index out of range