matrix_to_subcorpus {RcppCWB} | R Documentation |
Create CWB subcorpus from matrix with regions.
Description
Create CWB subcorpus from matrix with regions.
Usage
matrix_to_subcorpus(region_matrix, corpus, subcorpus)
Arguments
region_matrix |
A two-colum |
corpus |
A |
subcorpus |
A length-one |
Examples
## Not run:
# First we generate a subcorpus from a query result
oil_context <- cqp_query("REUTERS", subcorpus = "OIL", query = '[]{3}"oil" []{3}')
m <- subcorpus_get_ranges(oil_context)
reuters <- cl_find_corpus("REUTERS", registry = get_tmp_registry())
p <- matrix_to_subcorpus(subcorpus = "OIL2", corpus = reuters, region_matrix = m)
cqp_list_subcorpora("REUTERS")
x <- cqp_query("REUTERS:OIL2", query = '"crude";', subcorpus = "CRUDEOIL")
subcorpus_get_ranges(x)
# clean up
cqp_drop_subcorpus("REUTERS:OIL")
cqp_drop_subcorpus("REUTERS:OIL2")
cqp_drop_subcorpus("REUTERS:CRUDEOIL")
## End(Not run)
[Package RcppCWB version 0.6.4 Index]