You could use 2 easy method

1) make a dictionary of common words for every language and test it
against the sentence. If a language has multiple match against more
words, then probably that is the language is written in;

2) (maybe a fallback if previous method didn't work or was not useful)
every language has a particular frequency of some letter - eg. in
english i think the letter "e" is very common. you should find this
rules (with google) and apply to your case.

those are just ideas, hope helped anyway

On Nov 11, 9:48 am, alan lam <[email protected]> wrote:
> Is there any function/library/API which can detect the language of a
> particular piece of text (no internet connection)?
> i.e. for an input text "This is a sentence", it should detect the
> language as "English".
> Or for "Esto es una sentencia" it should detect the language as
> "Spanish".

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to