Adds a single word to the trie.

trie_add(trie, word_to_add)

Arguments

trie

A trie.

word_to_add

The word to be added in the trie.

Value

a logical indicating that if the addition is successful or not. Returns TRUE if word is added successfully Returns FALSE if the word already exists in the trie.

Examples

trie <- trie_create() trie_add(trie, "test")
#> [1] TRUE