An offline Android multi-language dictionary


Please note that this blog has been moved.

Now it has its own domain: mynixworld.info🙂

If you want to read the latest version of this article (recommended) please click here and I open the page for you.

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

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:

your dictionary info

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

some weired languages you might learn

some weired languages you might learn

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

the main window explained

the main window explained

We have menus too:

when menu button is pressed

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:

customize your application settings

customize your application settings

We have more:

settings page continue...

settings page continue…

If you want to tune the level of details:

tune the level of details

tune the level of details

But what are those details, anyway:

the detail page explained

the detail page explained

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

installing a new 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:
camera_shooting
So my little droid knows now to take a photo, to crop the image around that word:
camera_crop
…another little OCR droid knows to convert the weired image to text so a picture became a text:

OCR at work

OCR at work

About Eugen Mihailescu

Always looking to learn more about *nix world, about the fundamental concepts of arithmetic, algebra and geometry. I am also passionate about programming, database and systems administration.
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

2 Responses to An offline Android multi-language dictionary

  1. Timoci Havili says:

    How can I create a new language file for use with your app?

    • 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s