Mimino666 / langdetect

Port of Google's language-detection library to Python.
Other
1.71k stars 196 forks source link

langdetect returns IndexError rather than LangDetectException #102

Open MaxAwan opened 2 years ago

MaxAwan commented 2 years ago
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