Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autodetect language of a text in Java (Android) [closed]

Tags:

java

android

For my app I'd like to, given a text , detect its language (the ISO code and a chance for example). I'd like to know if there is some kind of web service or java library for doing so.

Thanks in advance

like image 764
Addev Avatar asked Sep 16 '11 11:09

Addev


People also ask

How to detect language of string Android?

To identify the language of a string, call LanguageIdentification. getClient() to get an instance of LanguageIdentifier , and then pass the string to the identifyLanguage() method of LanguageIdentifier .

How can I find the language of a text?

Google Translate - If you need to determine the language of an entire web page or an online document, paste the URL of that page in the Google Translate box and choose “Detect Language” as the source language.

Can Android read Java?

Java is technically not supported on Android XResearchsource , meaning that you can't run JAR files or visit websites with Java content. Luckily there are a few ways around these restrictions, depending on what you want to do.


1 Answers

Auto-detecting the natural language of a text is relatively easy using a bigram analysis algorithm. You can either implement it by yourself or simply use some existing library, e.g. Language-Detection project.

like image 62
Matej Avatar answered Oct 06 '22 00:10

Matej