Span(start, end)
as.Span(x)
is.Span(x)
Span()
and as.Span()
, a span object (of class
"Span"
). For is.Span()
, a logical.
Span objects provide sequences (allowing positional access) of single
spans. They have class "Span"
. Span objects can be coerced to
annotation objects via as.Annotation()
(which of course is
only appropriate provided that the spans are character spans of the
natural language text being annotated), and annotation objects can be
coerced to span objects via as.Span()
(giving the character spans
of the annotations).
Subscripting span objects via [
extracts subsets of spans;
subscripting via $
extracts integer vectors with the sequence
of values of the named slot.
There are several additional methods for class "Span"
:
print()
and format()
;
c()
combines spans, and
as.list()
and as.data.frame()
coerce, respectively, to
lists (of single span objects) and data frames (with spans and slots
corresponding to rows and columns). Finally, one can add a scalar and
a span object (resulting in shifting the start and end positions by
the scalar).
Span()
creates span objects from the given sequence of start
and end positions, which must have the same length.
as.Span()
coerces to span objects, with a method for annotation
objects.
is.Span()
tests whether an object inherits from class
"Span"
(and hence returns TRUE
for both span and
annotation objects).