Export columns from a tCorpus as span annotations (annotations over a span of text).
The annotations are returned as a data.table where each row is an annotation, with columns:
doc_id, variable, value, field, offset, length and text. The key purpose is that these span annotations
are linked to exact character positions in the text. This also means that this function can
only be used if position information is available (i.e. if remember_spaces=T was used when creating the tCorpus)
Usage
export_span_annotations(tc, variables)
Value
A data.table where each row is a span annotation, with columns: doc_id, variable, value, field, offset, length, text
Arguments
tc
A tCorpus, created with create_tcorpus, where remember_spaces must have been set to TRUE
variables
A character vector with variables (columns in tc$tokens) to export
Details
Note that if there are spans with gaps in them (e.g. based on proximity queries), they are split into different annotations.
Thus some information can be lost.