digitalmars.D.learn - Build your own Trie entry table
- Remi Thebault (17/17) Dec 26 2016 Hello
- Dmitry Olshansky (7/24) Dec 27 2016 This must be an oversight on my part. Indeed it should be
- Remi Thebault (5/14) Dec 28 2016 Done:
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
Dec 26 2016
On Monday, 26 December 2016 at 10:12:20 UTC, Remi Thebault wrote: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).This must be an oversight on my part. Indeed it should be possible to store/load your own trie.Can you give indication on the workflow one should follow for this use case?Please file a bug report for Phobos basically stating your use case and the visibility problem.Thanks Rémi---- Dmitry Olshansky
Dec 27 2016
On Tuesday, 27 December 2016 at 19:19:49 UTC, Dmitry Olshansky wrote:On Monday, 26 December 2016 at 10:12:20 UTC, Remi Thebault wrote:Done: https://issues.dlang.org/show_bug.cgi?id=17038 RemiNow 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.Please file a bug report for Phobos basically stating your use case and the visibility problem.
Dec 28 2016