Need info to build an Offline Dictionary

168 views
Skip to first unread message

Nikita Gupta

unread,
Dec 18, 2014, 12:58:00 PM12/18/14
to phon...@googlegroups.com
Hi,

I'm planning to build an offline dictionary (translation) of english words into my native tongue. The doc file has 258 pages and i'm wondering what would be the best possible way to create this app using phonegap.

Creating one page for 1 word if out of question.

One idea that struck me is to create 26 pages for letters A-Z and use an accordion effect in each page for every word. I'm wondering if this will be any good in terms of performance.

Can you guys suggest something better?

I code in html/css/jquery/ajax/php and mysql and phonegap is perfect as i'll need this app for iphone/android and others. My friend will share the iphone developer certificate for me.

John Bent

unread,
Dec 19, 2014, 10:38:56 AM12/19/14
to phon...@googlegroups.com
Very cool. I'm trying to do the same exact thing for the Palauan language. I have a database already online but really want it also to be available offline on smart devices since Palau has very poor internet connectivity. Perhaps we can develop something together that just loads different databases?

Steve Husting

unread,
Dec 19, 2014, 10:40:55 AM12/19/14
to phon...@googlegroups.com
You would have one page in which the user decides how to find the word: via a search field or selecting a letter of the alphabet.
Click-through search results could be on a different page.
Words starting with the letter of the alphabet would be on a separate template page, filled in by the database.
The word/meaning would be on the same template page, again filled in by the database.
So you have only 4 pages, and you can probably make it SPA, single-page architecture.

Nikita Gupta

unread,
Dec 21, 2014, 10:58:49 AM12/21/14
to phon...@googlegroups.com
John, Would love to work together on this. I'm still researching on phonegap and its usage. I manage to create helloworld basic app so far.

Steve, do you have any working example of your suggested architecture? Meanwhile, i'm googling. Would be great if you could share a zip or two with working examples :)

Thank You

Kerri Shotts

unread,
Dec 22, 2014, 1:26:22 PM12/22/14
to phon...@googlegroups.com
Not a working example, but this might help:

SQLite Database:
   Translations table:
       English: Text
       Native: Text
       Language: Text

For example:

    English, Native, Language
    "hello", "hola", "ES"            // spanish
    "hello", "bonjour", "FR"       // french

You could, of course have additional information included, including parts of speech, a definition, example usages, etc. Some of that would do well to go in a separate table, though.

Also, I'm including the Language column just as an attempt at generalization -- for a single target language, you could drop it.

App architecture:

Search / Lookup View:
    Language List/Toggle:  lets the user pick the source/target language
    Search field: lets the user search for a specific word (I'd suggest being a bit fuzzy here, rather than requiring exact matches)
    Submit: actually look up the word (OR, do live searching as the user types.)

    Single letter alphabetic list for the source language; For example, "A" would be equivalent to searching for "A*" (where * is a wildcard that matches anything)

Word List View:
    Given a search string, it would query the database for any matching entries. Each entry is then displayed in alphabetical order (or, perhaps, "most relevant" order). If there's a lot of info, you could go one step further and let the word link to a "Word View" where all the information is displayed.

    > If the query is large, consider paging. Large DOMs do not perform well.

Depending on how far you go, you'd end up with 1 - 3 views (and these are really "pages" or "view controllers", because the actual rendering of a single word would really be considered a "view").

I'd definitely suggest doing this as a Single Page Architecture app. Shouldn't be too hard to do the basics -- the hardest part would be any fuzzy searching or sorting by relevance. Be careful with anything requiring diacritics and the like here, because on a fuzzy filter, I would expect "apres" tp match "apr`es" (I'm too lazy to type the actual accented letter, sorry), but that can be hard to do.

If I just made everything more confusing, my apologies! It's a Monday! ;-)

Steve Husting

unread,
Dec 29, 2014, 11:10:46 AM12/29/14
to phon...@googlegroups.com
Nikita,
No working example, sorry. It's just how I would do it if I had the project.
Reply all
Reply to author
Forward
0 new messages