Learn R Programming

polmineR (version 0.7.9)

get_token_stream: Get Token Stream Based on Corpus Positions.

Description

Turn regions of a corpus defined by corpus positions into the original text.

Usage

get_token_stream(.Object, ...)

# S4 method for numeric get_token_stream(.Object, corpus, p_attribute, encoding = NULL, collapse = NULL, beautify = TRUE, cpos = FALSE, cutoff = NULL, ...)

# S4 method for matrix get_token_stream(.Object, ...)

# S4 method for character get_token_stream(.Object, left = NULL, right = NULL, ...)

# S4 method for partition get_token_stream(.Object, p_attribute, collapse = NULL, cpos = FALSE, ...)

# S4 method for regions get_token_stream(.Object, p_attribute = "word", ...)

Arguments

.Object

an object of class matrix or partition

...

further arguments

corpus

the CWB corpus

p_attribute

the p-attribute to decode

encoding

encoding to use

collapse

character string length 1

beautify

logical, whether to adjust whitespace before and after interpunctation

cpos

logical, whether to return cpos as names of the tokens

cutoff

maximum number of tokens to be reconstructed

left

left corpus position

right

right corpus position

Examples

Run this code
# NOT RUN {
get_token_stream(0:9, corpus = "GERMAPARLMINI", p_attribute = "word")
get_token_stream(0:9, corpus = "GERMAPARLMINI", p_attribute = "word", collapse = " ")
fulltext <- get_token_stream("GERMAPARLMINI", p_attribute = "word")
# }

Run the code above in your browser using DataLab