get_collocations {dhlabR}R Documentation

Get collocations for word in corpus

Description

This function retrieves collocation data from a corpus using a given word and a list of unique identifiers (pids) of corpus data frame.

Usage

get_collocations(pids, word, before = 10, after = 10, sample_size = 5000)

Arguments

pids

A vector or data frame containing the unique identifiers of the texts in the corpus.

word

The target word for which you want to find concordances.

before

The number of words before the target word to include in the context (default is 10).

after

The number of words after the target word to include in the context (default is 10).

sample_size

The number of samples to retrieve from the API (default is 5000).

Value

A data frame of concordances.

Examples

pids <- c("URN:NBN:no-nb_digibok_2008051404065", "URN:NBN:no-nb_digibok_2010092120011")
word <- "."
collocations <- get_collocations(pids, word)


[Package dhlabR version 1.0.6 Index]