StringSet-class: The Opaque StringSet reference class

StringSet-classR Documentation

The Opaque StringSet reference class

Description

This is a class that represents a reference to a set of strings in the libstree library. The underlying data structure can be thought of as a character vector in which the order is not meaningful. The set is a collection of strings. In R, we can compute its length and index its elements via the [ operator. This is convenient, for example, when sampling from the set. However because the order is not respected when constructing the set from a character vector, one cannot treat this as a regular character vector in R.

Objects from the Class

The preferred way to create a StringSet is via the generic StringSet function.

Slots

ref:

Object of class "externalptr". This is a reference to the internal C-level object that represents the string set in libstree. This external pointer has a tag value StringSet.

Methods

SuffixTree

signature(x = "StringSet"): ...

[

signature(x = "StringSet", i = "numeric"): ...

append

signature(x = "StringSet", values = "character"): ...

coerce

signature(from = "StringSet", to = "character"): ...

lapply

signature(X = "StringSet", FUN = "function"): ...

length

signature(x = "StringSet"): ...

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.cl.cam.ac.uk/~cpk25/libstree/libstree http://www.omegahat.org/Rlibstree

See Also

StringSet

Examples


words = c("stemming", "boing", "springs")
set = StringSet(words)

lapply(set, function(x) nchar)

 # Check that we can accept additional arguments
lapply(set, substring, 1, 2)



omegahat/Rlibstree documentation built on Jan. 17, 2024, 6:37 p.m.