dtrie 1.0.1

Dictionary representation of Trie


To use this package, run the following command in your project's root directory:

DTrie

The dictionary representation of the Trie data structure.

Examples

auto dictionary = new Dictionary(["Win", "hot"], ["Lose", "cold"]);

assert(dictionary.get("Win") == ["Lose"]);
assert(dictionary.get("hot") == ["cold"]);
assert(dictionary.get("won") == []);

Multi-byte strings are available.

string[] keys = [
    "あけます", "あけます",
    "あけました", "あけました",
];

string[] values = [
    "開けます", "明けます",
    "開けました", "明けました",
];

auto dictionary = new Dictionary(keys, values);

//"あけます" is associated to "開けます" and "明けます" 
assert(dictionary.get("あけます") == ["開けます", "明けます"]);
//"あけました" is associated  to "開けました" and "明けました" 
assert(dictionary.get("あけました") == ["開けました", "明けました"]);

Running Tests

$dmd test.d bitarray.d lib/exception.d lib/random/random.d lib/random/string.d queue.d dtrie.d -unittest 
$./test

Documentations can be generated by appending -D option to the compilation command.

Authors:
  • Ishita Takeshi
Dependencies:
none
Versions:
1.0.2 2015-Dec-03
1.0.1 2015-Jul-15
1.0.0 2015-Jul-15
~master 2016-Jan-07
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 144 downloads total

Score:
0.5
Short URL:
dtrie.dub.pm