Hi all,
I've implemented Ternary Search Trees (
http://www.drdobbs.com/database/184410528) with the optimizations described here
http://www.strchr.com/ternary_dagsThere 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,
Comments
Likes: MoKaLux