On Thu, Nov 11, 2010 at 8: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".

I don't think you can do it without internet connection and utilising
some API (like Google Translate) with massive dictionaries behind it.

To establish letter frequencies, you would need to capture quite lot
of text (well, more than 1 sentence) for the analysis to be
statistically valid, otherwise you would have many errors. The
differences are small towards the end of the tail.

Please have a look at this article, to see, what you would be against:
http://en.wikipedia.org/wiki/Letter_frequency

Similar issue is with local dictionaries: you would need them to be
quite big in order to achieve decent results. Scanning those would
take time.


Daniel

-- 
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