A JavaScript source port of Nakatani Shuyo's excellent language detection library in Java.