class CryPrompt::CryPromptTrie

Overview

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

Defined in:

cryprompttrie.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(word : Nil | String = nil, description : Nil | String = nil) #

[View source]

Instance Method Detail

def <<(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


[View source]
def [](word : String) #

returns the first child node where the node's children


[View source]
def child_nodes : Array(CryPromptTrie) #

[View source]
def child_nodes=(child_nodes : Array(CryPromptTrie)) #

[View source]
def description : String | Nil #

[View source]
def description=(description : String | Nil) #

[View source]
def exists?(word : String | Nil) #

checks if a node exists based on the word


[View source]
def nodes : Array(CryPrompt::CryPromptTrie) #

returns the child nodes as nodes


[View source]
def nodes_to_string_array #

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


[View source]
def word : String | Nil #

[View source]
def word=(word : String | Nil) #

[View source]