Very nearly this same technique is used in glibc for representing unicode character classes.  Essentially you save a huge amount of space by sharing common leaf nodes of the trie.<p>I wrote code to construct these quickly during startup for JOE.  I also noticed the minimizing you can do while building the trie in order: basically if the last constructed leaf matches the previous one, use it instead.  In JOE we also have sets (for character class) or maps (for regex and case conversion tables).