Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Compressed ternary DAGs for dictionary search — Gideros Forum

Compressed ternary DAGs for dictionary search

atilimatilim Maintainer
edited April 2012 in Code snippets
Hi all,

I've implemented Ternary Search Trees (http://www.drdobbs.com/database/184410528) with the optimizations described here http://www.strchr.com/ternary_dags

There are a bunch of advantages compared to other dictionary search techniques:
1. It's fast: On my Samsung S II, the search speed is about 30000-50000 searches per second.
2. It's compact and GC friendly: The loaded dictionary file is only a single string. We don't create tables with many fields. And after compression, usually the dictionary file is smaller than the original file.

You can create your dictionaries by using the code buildtst.cpp. And the search algorithm is included in main.lua.

cheers,
+1 -1 (+3 / -0 )Share on Facebook

Comments

Sign In or Register to comment.