File: Span.Rd

package info (click to toggle)
r-cran-nlp 0.3-2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 456 kB
  • sloc: makefile: 2
file content (75 lines) | stat: -rw-r--r-- 2,368 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
\name{Span}
\alias{Span}
\alias{as.Span}
\alias{is.Span}
\alias{[.Span}
%% \alias{[<-.Span}
\alias{[[.Span}
%% \alias{[[<-.Span}
\alias{$<-.Span}
\alias{Ops.Span}
\alias{as.data.frame.Span}
\alias{as.list.Span}
\alias{c.Span}
\alias{duplicated.Span}
\alias{format.Span}
\alias{length.Span}
\alias{names.Span}
\alias{print.Span}
\alias{unique.Span}
\title{Span objects}
\description{
  Creation and manipulation of span objects.
}
\usage{
Span(start, end)
as.Span(x)
is.Span(x)
}
\arguments{
  \item{start, end}{integer vectors giving the start and end positions
    of the spans.}
  \item{x}{an \R object.}
}
\details{
  A single span is a pair with \dQuote{slots} \sQuote{start} and
  \sQuote{end}, giving the start and end positions of the span.

  Span objects provide sequences (allowing positional access) of single
  spans.  They have class \code{"Span"}.  Span objects can be coerced to
  annotation objects via \code{\link{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 \code{as.Span()} (giving the character spans
  of the annotations).

  Subscripting span objects via \code{[} extracts subsets of spans;
  subscripting via \code{$} extracts integer vectors with the sequence
  of values of the named slot.

  There are several additional methods for class \code{"Span"}:
  \code{print()} and \code{format()};
  \code{c()} combines spans (or objects coercible to these using
  \code{as.Span()}), and
  \code{as.list()} and \code{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).

  \code{Span()} creates span objects from the given sequences of start
  and end positions, which must have the same length.

  \code{as.Span()} coerces to span objects, with a method for annotation
  objects.

  \code{is.Span()} tests whether an object inherits from class
  \code{"Span"} (and hence returns \code{TRUE} for both span and
  annotation objects).
}
\value{
  For \code{Span()} and \code{as.Span()}, a span object (of class
  \code{"Span"}).

  For \code{is.Span()}, a logical.
}