How can I detect a user's input language using

2019-02-19 18:03发布

I'm looking for a library or technique to detect the input language of blocks of text provided by users. Online lookups (like Google translate) won't work for this task as I'm writing an app which must run offline.

Thanks.

4条回答
萌系小妹纸
2楼-- · 2019-02-19 18:36

Here are two more n-gram-based gems you might want to try. They work offline.

查看更多
Explosion°爆炸
3楼-- · 2019-02-19 18:40

For anyone interested, I've found http://rubygems.org/gems/kenwaln-whatlanguage, which is performing excellently.

查看更多
成全新的幸福
4楼-- · 2019-02-19 18:43

I'm using CLD which I really like, succinct and easy to use. Give it a try.

查看更多
登录 后发表回答