indix / whatthelang

Lightning Fast Language Prediction 🚀
Apache License 2.0
165 stars 23 forks source link

index out of range #13

Open jyhnnhyj opened 5 years ago

jyhnnhyj commented 5 years ago

I'm using version 1.0.2 - fails when I use the single word "hallo" - here is a quick repro:

$ python
Python 3.7.1 (default, Dec 14 2018, 19:28:38)
>>> from whatlang import WhatLang
>>> wl = WhatLang()
>>> wl.predict_lang("hallo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "........../site-packages/whatlang/predict_lang.py", line 32, in predict_lang
    if len(pred[0]) == 0:
IndexError: list index out of range
whiletruelearn commented 5 years ago

@jyhnnhyj Not sure where you have downloaded the library from . But the import statement looks wrong. It should have been from whatthelang import WhatTheLang

For this particular input, the result i see is CANT_PREDICT which makes sense as this is not an english word.