Creation and manipulation of tagged token objects.
Tagged_Token(token, tag)
as.Tagged_Token(x)
is.Tagged_Token(x)
For Tagged_Token()
and as.Tagged_Token()
, a tagged token
object (of class "Tagged_Token"
).
For is.Tagged_Token()
, a logical.
character vectors giving tokens and the corresponding tags.
an R object.
A tagged token is a pair with “slots” ‘token’ and ‘tag’, giving the token and the corresponding tag.
Tagged token objects provide sequences (allowing positional access) of
single tagged tokens. They have class "Tagged_Token"
.
Subscripting tagged token objects via [
extracts subsets of
tagged tokens; subscripting via $
extracts character vectors
with the sequence of values of the named slot.
There are several additional methods for class "Tagged_Token"
:
print()
and format()
(which concatenate tokens and tags
separated by /);
c()
combines tagged token objects (or objects coercible to
these using as.Tagged_Token()
), and
as.list()
and as.data.frame()
coerce, respectively, to
lists (of single tagged token objects) and data frames (with tagged
tokens and slots corresponding to rows and columns).
Tagged_Token()
creates tagged token objects from the given
sequences of tokens and tags, which must have the same length.
as.Tagged_Token()
coerces to tagged token objects, with a
method for TextDocument
objects using
tagged_words()
.
is.Tagged_Token()
tests whether an object inherits from class
"Tagged_Token"
.