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

Logic error? #21

Closed PlNG closed 10 years ago

PlNG commented 10 years ago

I found a small logic error on LanguageDetect.js#L176

if I'm reading this equality conversion chart correctly you're checking if the argument 'sample' is equal to 0 (zero), the empty array [], the empty string '', null, and false, but the first expression being true makes the second expression false.

RuslanZavacky commented 10 years ago

Thanks, this is a bug actually, fixed it now.