dtrie 1.0.2

Dictionary representation of Trie


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

DTrie

The dictionary representation of the Trie data structure.

Usage

import dtrie;

auto dictionary = new DTrie!(T)(keys, values);
assert(dictionary[keys[0]] == [values[0]]);

Where T is the type of an element of values.

Examples

import dtrie;

auto dictionary = new DTrie!string(["Win", "hot"], ["Lose", "cold"]);
assert(dictionary["Win"] == ["Lose"]);
assert(dictionary["hot"] == ["cold"]);
dictionary["won"];  //KeyError

Multi-byte strings are available.

import dtrie;

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

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

auto dictionary = new DTrie!(string)(keys, values);

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

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

Build options

  • Running Tests

$dub test
  • Generating documentations

$dub build --build=docs
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

  • 135 downloads total