jtoy / cld

compact language detection in ruby
BSD 3-Clause "New" or "Revised" License
210 stars 67 forks source link

Output in case of mixed languages #12

Closed vipulvkp closed 7 years ago

vipulvkp commented 7 years ago

Hi, I am giving a big string to the cld to detect the language as below CLD.detect_language(" ... a big string ...")

Now the interesting part is that "a big string " contains some french , some chinese and some english. So what is the underlying logic that the gem uses to decide the language of that ".. big string .."

Regards

grosser commented 7 years ago

I think it checks for common characters and then picks the one with the highest confidence ... so 10% german + 90% chinese = chinese