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. How to access the rest of R.drawable (such as emoticons)?

Look at the source code of Android and copy the files in your app.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~

2. ScrollView size issue

ok I have this xml :
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <org.me.webwagdroid.GridLayout
        android:id="@+id/gridlayout"

        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

</FrameLayout>

I know try to use my Grid Layout in a ScrollView

So i Just replace FrameLayout by ScrollView with some scrollbars
attribute
but now my grid layout can't resolve the size.
I can't understand why since a ScrollView is a FrameLayout
--~--~---------~--~----~------------~-------~--~----~

3. Have any API can control CPU frequency?

4. a question about final variable and multiple constructors

5. How to move a ImageView step by step by TranslateAnimation

6. How to pass User created object between two Activity in same Application?

7. What is the "package name" and the "Create Activity" in wizard of new project (eclipse)