FGRibreau / node-language-detect

🇫🇷 NodeJS language detection library using n-gram
http://blog.fgribreau.com/2011/07/week-end-project-nodejs-language.html
MIT License
399 stars 45 forks source link

English text is detecting as Danish #42

Closed parweennargis closed 2 years ago

parweennargis commented 2 years ago

I am using the npm module languagedetect (version: ^2.0.0). For simple English string, it is returning the language as danish with the highest score and English with less score. const text = 'Test from backend'; const languages = lngDetector.detect(text, 2);

The response which I am getting in languages is: [["danish",0.2868627450980392],["english",0.2733333333333333]]

FGRibreau commented 2 years ago

see https://github.com/FGRibreau/node-language-detect/issues/41#issuecomment-1003045188 :)