class

CryPrompt::CryPromptTrie

Inherits Reference / Object

this will serve as the new suggestion tree structure. should be easier to maintain, troubleshoot, and fix it is a modified trie structure. probably not as efficient as using pointers but should be good enough to start with will not accept duplicate words entered

Constructors

new(word : Nil | String = nil, description : Nil | String = nil)
Source

Instance methods

<<(node : CryPromptTrie)

add a node to the current nodes child nodes do not add a node unless the node has a word. ie only the root node's word can be nil

Source
[](word : String)

returns the first child node where the node's children

Source
child_nodes
Source
child_nodes=(child_nodes : Array(CryPromptTrie))
Source
description
Source
description=(description : String | Nil)
Source
exists?(word : String | Nil)

checks if a node exists based on the word

Source
nodes

returns the child nodes as nodes

Source
nodes_to_string_array

returns an array of strings containint the current nodes children's words

Source
word
Source
word=(word : String | Nil)
Source