detect the language of a particular piece of text (no internet connection)

by alan lam » Thu, 11 Nov 2010 16:48:33 GMT


Sponsored Links
 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".

--



detect the language of a particular piece of text (no internet connection)

by Kumar Bibek » Fri, 12 Nov 2010 02:11:41 GMT


 There are no such APIs that I am aware of in the Android SDK. There
might be some 3 party libraries, but again, I haven't searched for
them. Try googling.




--


Sponsored Links


detect the language of a particular piece of text (no internet connection)

by moffetta » Fri, 12 Nov 2010 02:21:58 GMT


 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




--



detect the language of a particular piece of text (no internet connection)

by Daniel Drozdzewski » Fri, 12 Nov 2010 18:58:30 GMT


 


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

--



Other Threads

1. any helpful documentation ?

hi all - Im posting this here because Im not being allowed on
android-beginners .I have sent the request for two weeks. I am an
amtuer in android , is there any site or helpful place  other than the
developer-android for android beginners?

-- 

2. Modding (WAS: Suara spica kok agak kresek2?

Ini istilahnya nge flash ya, om Satrio?
Ini saya lg download nih, LK.2-06Beta4 nya.

Thanks,

Ludi




> 

3. access message inbox without Content UrI (content//:sms)

4. how to programatically pause an application?

5. How do I auto-generate code from xml like Android does it?

6. 1200 mAh Momax battery for Milestone/Droid

7. Speed issue: content provider vs plain sqlite db