My *nix world

An offline Android multi-language dictionary

This project started when I've begun to learn a Nordic language and I realized that the only good dictionaries are those online but, and don't laugh, I have no 3G Internet connection on my Android smart phone (because I am stingy when comes to money) and it would be nice if I would find some freeware (see? I'm stingy again) offline Android multi-language dictionary. Those that I've found were either limited in functionality, speed or content. So I've chose to write my own application instead.

Lexicon is a Android application that allows you to browse a dictionary without Internet connection. It was written with multi-language support in mind, multi-dictionaries, simple but effective user interface.

Because Android provides API for accessing a Sqlite databases, the choice of using Sqlite as the application backend came naturally. This choice made possible that a 46000 words dictionary search,using a Sql LIKE matching-pattern, to take only half of a second.

There are plenty of offline-dictionary programs made available out there (see Google Play) so why do we need a new one?

I think that few of the reasons could be the following:

Works with Android SDK

At the moment when this wiki was written I've tested this application with the Android SDKs mentioned below. It might works with other versions too, though.

Note that if you would like to use the application *without OCR functionality* you have to fork the project and to remove the Tesseract API dependency and to comment the code from getTextFromOCRBitmap method from Main.java, as I've explained here.

Without OCR functionality

  • >= 2.1 (API 7)

With OCR functionality

  • >= 2.3.3 (API 10)

Features

License

This project is licensed under the Apache License, Version 2.0.

Other dependencies

Dictionary sources

The English Swedish dictionary is provided by Folkets lexicon, it can be used under the Distributed Creative Commons Attribution-Share Alike 2.5 Generic license.

All other available dictionaries are exclusively provided by Lexin and should be used according with their terms of use.

The project home page

The project and its code is open and free for everyone, its home page is hosted at bitbucket.org.

Screenshots

Because a pictures says more than 1000 words I made few screen shots to see the little droid at work.

You can install as many dictionaries you want. Anyway, once installed you can switch between them easily.

offline Android multi-language dictionary

select dictionary to use

Every dictionary is a small SQLite database so everything you query will be fast. By the way, it chews 23000+ words like a breeze:

offline Android multi-language dictionary

your dictionary info

The application is thought to work with any kind of weird language (don't get me wrong, but what I can't read it's weired to me):

offline Android multi-language dictionary

some weired languages you might learn

Maybe it's time to see the main window, otherwise you might think to leave quickly this page:

offline Android multi-language dictionary

the main window explained

We have menus too:

offline Android multi-language dictionary

when menu button is pressed

Because we talk about the menus and because settings seems more interesting, let's see what settings one might change:

offline Android multi-language dictionary

customize your application settings

We have more:

offline Android multi-language dictionary

settings page continue...

If you want to tune the level of details:

offline Android multi-language dictionary

tune the level of details

But what are those details, anyway:

offline Android multi-language dictionary

the detail page explained

While a new dictionary is installing you know what's going on:

offline Android multi-language dictionary

installing a new dictionary

Once a pal asked me if it's possible to make a photo instead of typing the word because he does not have the Arabic keyboard/symbols and he want to check what a specific Arabic word means:
offline Android multi-language dictionary
So my little droid knows now to take a photo, to crop the image around that word:
offline Android multi-language dictionary
...another little OCR droid knows to convert the weired image to text so a picture became a text:

offline Android multi-language dictionary

OCR at work

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
An offline Android multi-language dictionary

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
An offline Android multi-language dictionary

Latest posts by Eugen Mihailescu (see all)

31 thoughts on “An offline Android multi-language dictionary

    1. Eugen Mihailescu

      The application is meant to use a SQLite dictionary language file, not to create one. Nevertheless there are over 20 available dictionaries out there (English,Albanian, Azerbaijani, Amharic, Arabic, Bosnian, Croatian, Finnish, Greek, Macedonian, Northern Kurdish, Pashto, Persian, Russian, Roma (Arli), Romanian, Serbian, Somali, Spanish, Swedish, South Kurdish, Tigrinya, Turkish, and Vietnamese turabdinska). These dictionaries are very well designed, a cooperation between the Institute for language and folklore and Kungliga Tekniska högskolan (Sweden). Unfortunately not all the dictionaries are provided as XML files but they still exists there (as a web application where you can specify the searched word in the source language then target language and it translate it) BUT what you can do is to enquiry the web application for all words that you may think of and to get as response their corresponding translation.

      For instance http://lexin.nada.kth.se/lexin/service?searchinfo=to,swe_fin,katt will use the source Swedish word "katt" and the target Finish language and will provide a response HTML file with everything about that translation.

      If you parse that web page then you can extract the definition. So you will end up by building a XML language file. Using that XML language file all you have to do is to create a SQLite database with the same structure like those dictionaries provided by default.

      Hey, why should you bother with that? I've already created an application for you that does all these things:

      • lexikon2sqlite - if you've downloaded a lexin2nada XML dictionary then it creates the final SQLite database dictionary from it
      • nadaparser - if there is no XML dictionary available then it queries the web application for all words (specified by a source language) and will create the corresponding SQLite dictionary for the target language

      I guess that nadaparser is the application you need.

      Anyway, there might be situations where the online The People's dictionary does not have your target language so none of those mentioned applications will help you to create such a SQLite dictionary file. If that is the case then I see only two options:

      • create a XML dictionary with the same XML structure like the default provided then use lexikon2sqlite to create the final SQLite dictionary database from it
      • clone a SQLite dictionary database (provided by default), delete its records then populate it by hand with your source-target definitions, whatever that means
    1. Eugen Mihailescu Post author

      So, if you download/compile the lexikon2sqlite project's source code then you'll got a tool that allows you to the SQLite database (which actually will be one of those many dictionaries that you might install/use in the lexikon application).
      This feature is especially the one you are looking for:

      read a Lexin XML dictionary file and create a SQL script file that can be used to create the structure of tables as well as to insert all the word definitions into its corresponding tables

      So just compile that project, you will get a console application. Run it! It will provide a help for you so that you will know what parameter to use (it's very simple!). Use that XML dictionary and you'll get the SQLite script that you can use it to create the database or, depending on the options you specify, it will create the final database:

      read a Lexin XML dictionary file and create a SQLite database file, which is a verbatim copy of the original XML file (except that it is stored in the SQLite format)

      Anyway, all these information you can find on each project Wiki page, I've tried to describe as best as I could all these features. Moreover, the code is well documented so if you are a programmer (I hope you are 🙂 ) then it will help you understand each block of code.

  1. Timoci Havili

    It all sounds exciting, however being a stingy guy like you, I don't have eclipse and have not purchased premium key for Aide for Android. Can't compile a decent app without it... I know you've done the hard yards already, however, this stingy guy would like to ask for a ready made apk available for download already.... please let me know if there is...

    Thank you in advance.

    1. Eugen Mihailescu Post author

      I can compile the application for you, that's not a problem. Just let me know what dictionary do you need (eq. English -> Spanish or Spanish -> English) and I will try in my spare time to prepare that for you. By the way, I don't have any Fijian or Fiji Hindi dictionary, so if you will need something exotic like this all that I can do for you is just to give you a prepared but empty SQLite dictionary database which you will populate with data by yourself.
      PS: Eclipse is free and if you want to develop/compile applications for Android that's free too. All you need is Google's Android SDK which can be plugged-in Eclipse via Eclipse ADT plugin (read more).

      1. Timoci Havili

        I would be most appreciative if you would do that for me. I have a Fijian Dictionary in pdf format that I will be populating the sqlite database with. It isn't that comprehensive but it sure is a starting point.

        Again thank you in advance.

  2. Farid

    First of all I really appreciate for sharing the code
    I successfully compiled and ran the project but have a prob
    when the app runs it does not find any dic file, so popup a dialogue for downloading the dictionary files, I can download it but immediately after downloading the app tries to extract the content to sd card and unexpectedly dialogue appears again and want to does not find any dic file and wants to download it again

    i tried many time would you pls let me handle it

    BR

        1. Eugen Mihailescu Post author

          >> i tried many time would you pls let me handle it
          If you can track down the problem you are free to fix it. I always encourage the people to take initiative and fix the things (software,hardware,etc) for themselves. That you you will understand better the product, will be able to fix it in minutes and to create enhanced versions of it.

  3. pratibha

    the app not working properly.upon installation it error dialog pops up "no dictionary installed do u want to install one" upon installation only dict.xml is created in downloads folder but of no use.

    1. Eugen Mihailescu Post author

      The application does not come like a pre-packaged one-click install application. Instead it was made available as an open-source project that you can download, compile and run on whatever device supports it. If you find a bug or something that needs to be improved you are welcome to contribute. Furthermore, there are other applications connected to this one that allow you to grab (by parsing) other dictionaries, to compile them (as .sqlite databases) and use them. Please read the entire Wiki page of the project (https://bitbucket.org/eugenmihailescu/lexicon/wiki/Home).

  4. pratibha

    after compilation only the above mentioned problem occured.can u please explain me the application constant i.e host url,root url tht u have used.Do u hav dictionary stor

  5. pratibha

    after compilation only the above mentioned problem occured.can u please explain me the application constant i.e host url,root url tht u have used.Do u hav dictionary stored in dropbox???

    1. Eugen Mihailescu Post author

      Obviously you should fork the project source code and create your own version of the project where you can, for instance, to decouple entirely the OCR from the project. This means even to remove those application menus that refers the OCR option.

  6. diana

    Thnk
    I have one proble about you app it can't compile becouse your program have error syntak n when i download apk file.. compile in my devise same to not can running.. how about it??

    1. Eugen Mihailescu Post author

      I have no idea what could be the problem. If you are a long-time programmer you should already know that there are gazillions reason for a program which does not compile. As a programmer you have the skills and tools to identify the error and hopefully to fix it. The source are free (open) so you are on your own 🙂

  7. shareef

    Hi, the url private static final String DOWNLOAD_ROOT = "http://dl.dropbox.com/u/80414534"; cannot be reached which causes an exception !?! can you help me

Leave a Reply

Your email address will not be published. Required fields are marked *