powered by
This function retrieves collocation data from a corpus using a given word and a list of unique identifiers (pids) of corpus data frame.
get_collocations(pids, word, before = 10, after = 10, sample_size = 5000)
A data frame of concordances.
A vector or data frame containing the unique identifiers of the texts in the corpus.
The target word for which you want to find concordances.
The number of words before the target word to include in the context (default is 10).
The number of words after the target word to include in the context (default is 10).
The number of samples to retrieve from the API (default is 5000).
pids <- c("URN:NBN:no-nb_digibok_2008051404065", "URN:NBN:no-nb_digibok_2010092120011") word <- "." collocations <- get_collocations(pids, word)
Run the code above in your browser using DataLab