Build your own Trie entry table

Remi Thebault via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Dec 26 02:12:20 PST 2016


Hello

I want to map a dchar to its Bidi_Class.

I've built an utility that reads UnicodeData.txt into an AA and 
builds a trie with std.uni.codepointTrie from it.
I use Trie.store() to export the trie entry table into a D 
module. (I believe in a similar manner than phobos' 
unicode_tables.d)

Now I want to use this table to efficiently create a Trie in my 
code, the same way std.uni does, but found out that Trie 
constructor is private.

I've copy-pasted the asTrie function (and also TrieEntry struct) 
in my code and it works well (which I don't understand because my 
code still ends up calling the private ctor).

Can you give indication on the workflow one should follow for 
this use case?

Thanks
RĂ©mi


More information about the Digitalmars-d-learn mailing list