Skip to content

Support Tools Design Doc v 4.0

Elizabeth Crowdus edited this page May 31, 2018 · 5 revisions

Purpose

A shell which, when given a trie, can print out a variety of visualizations of the trie for debugging purposes.

Method

Currently, all commands within the shell must indicate the index of one of three hardcoded tries (0, 1, or 2). We hope to allow for a key-based interaction with a remote Redis server soon. This document will be updated when such functionality is integrated. At that time, the shell will interface with the API team's functions in order to access the Redis server.

Visualization Options

All Nodes

This visualization will be exhaustive and print out each node of the trie, whether or not the node is a word.

Use Cases

Debugging the flow of a trie

Command

print 0

0 refers to the index of the trie to access

All Nodes, Prefix

This visualization will be exhaustive and print out each child node of the trie of a certain prefix, whether or not the node is a word.

Use Cases

Debugging the flow of a trie

Command

print 0 all pre

0 refers to the index of the trie to access, pre is the prefix

Words

This visualization will print out every word in the trie.

Use Cases:

Debugging whether words are correctly counted as words and not strings

Words, Prefix

This visualization will print out every word in the trie with a given prefix.

Use Cases:

Debugging whether words are correctly counted as words and not strings

Leaves

This visualization will print out the leaves of the trie (or the words which have no children)

Use Cases:

Debugging how extensive the words the trie contains is

Command:

print 0 only-leaves

Leaves, Prefix

This visualization will print out the leaves of the trie (or the words which have no children)

Use Cases:

Debugging how extensive the words the trie contains is

Command:

print 0 only-leaves pre

Printing n-completions

This visualization will

Use Cases:

Command:

print # n-completions letter #

Index of Commands

Note: # refers to the hardcoded trie to call

  • Basic print: $ print #
  • Printing only words: $ print # only-words
  • Printing only words that begin with a prefix: $ print # only-words prefix
  • Printing only leaves $ print # only-leaves
  • Printing only leaves that begin with a prefix: $ print # only-leaves prefix
  • Printing n-completions: $ print # n-completions letter #

Team

  • Elizabeth Crowdus
  • Marco Kaisth
  • Maxine King
  • Hongji Li
  • Richard Pei

Acknowledgements

This project was supervised by:

  • Borja Sotomayor (class instructor)
  • Lydia Filipe (class TA)

Clone this wiki locally