newTree: Creates a new ternary search tree

Description Usage Arguments Details Value See Also Examples

View source: R/newTree.R

Description

Creates a new ternary search tree containing the input words

Usage

1
newTree(input)

Arguments

input

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

Details

Creates a new tree and adds the words contained in a vector or a file to the tree. 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 total number of words and nodes when finished.

Value

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

See Also

addToTree

Examples

1
2
3
4
5
fruitTree <- newTree(c("apple", "orange"))
fileConn <- file("XMIwords.txt")
writeLines(head(XMIwords,100), fileConn)
close(fileConn)
enTree <- newTree("XMIwords.txt")

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