开发者

Identifying (spoken) language in javascript

Does anyone know if there is any language detection script/library available for javascript? I like to incorporate it into nodejs but didn't found any.

I don't want a browser language detection but a string language detection. 'Hello 开发者_StackOverflow社区World' would be detected english and 'Hallo Wereld' would be detected as dutch.

Thanks in advance.


I just released node.js bindings for Google's Compact Language Detector: https://github.com/dachev/cld


I'm not that big into natural language processing but I suppose you could use Trigrams.

ActiveState has a Recipe of a simple Python version.

Of course you can always use a C++ library and write a wrapper for Node.js and compile that.


The Google Translate API allows language detection and works with JavaScript. You should check out the reference below:

http://code.google.com/apis/language/translate/v1/reference.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜