addToTree: Adds a set of strings to a ternary search tree

Description Usage Arguments Details Value See Also Examples

View source: R/addToTree.R

Description

Updates a ternary search tree adding the words or strings from the input

Usage

1
addToTree(tree, input)

Arguments

tree

an existing ternary search tree to add words to.

input

a filepath to read from or a character vector containing the strings.

Details

Updates the tree and adds the words contained in a vector or a file. Reports each 10000 words it has added to the tree and takes around 30 sec. per 10k words on a 8Gb RAM computer. In addition, reports the number of words added and the total number of nodes when finished.

Value

An object of class 'list' and 'tstTree'.

See Also

newTree

Examples

1
2
fruitTree <- newTree(c("apple", "orange"))
fruitTree <- addToTree(fruitTree, c("lemon", "pear"))

TSTr documentation built on May 1, 2019, 9:16 p.m.