javaandroidalgorithmserializationdawg

Saving a DAWG in java


I'm looking to create a DAWG structure to validate words entered by a user. This is going to be used in an Android App. Would my best option be to serialize a DAWG structure outside the app then load it upon the start? Or is there a better way to work with a DAWG?


Solution

  • If you have a small amount of data, you could definitely load up a pre-serialized graph at start, but you'll have to be careful about memory consumption. It'll be pretty easy to exhaust a low-end device's memory quickly if you have a large dictionary. It may be better to take the more memory-efficient approach and keep the graph on disk and only load individual nodes into memory as needed. This will require you to think out how you're serializing the graph.