0

I am trying to use a database for my application which needs a list of all the words in Arabic language, unfortunately this database is very large in size, more than 200 MB, I've seen that the only solution for such a problem is using a web service or having my database online and download it on first use which is not practical in my case since this is a game and the user can play it while he's disconnected, plus the download size will be large and it will use alot of space on his phone. I couldn't find a way to make the size of my DB reasonable.

My question is if there is a way to shrink the size of the database knowing that all the data stored in it is of the type text. I've noticed that the keyboard in my phone has an auto-complete feature, where is it getting the list of valid words from? Can i use it for my application?

4
  • sounds like you need to add indexing into your words so that you don't use so much space with the webservice.
    – JoxTraex
    Feb 9, 2012 at 8:13
  • I suspect that the auto-complete have just the most used words. Feb 9, 2012 at 8:18
  • @JoxTraex Use indexes to save space? Sorry, but that's just not making sense to me. Perhaps I'm missing something? Feb 9, 2012 at 8:19
  • By indexing, I mean breaking up the data in such a way that it can be referenced efficiently.
    – JoxTraex
    Feb 9, 2012 at 8:21

2 Answers 2

1

You'll want to store your words in a prefix tree (or trie). It is a space-efficient structure for this kind of data.

For more info, see: https://gamedev.stackexchange.com/questions/4142/best-way-to-store-a-word-list-in-java-android

1
  • Can you please suggest a strategy to use this, I tried serializing the trie to a file but its still very huge, using GZip works but still I'll have to load the Trie into memory which will take alot of space, I tried seperating the tries based on the first letter I still get files between 20 and 70 MB..
    – OKAN
    Feb 9, 2012 at 19:35
0

your database might have so much extra information included, for example grammar, inflections, comments etc. If this is the case, then re-create your database with only the limited data/columns you need to be used inside phone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.