Context: I have 47 .txt files which are all technically small corpora. They have been lowercased and full-stops have been removed.

Question: Would anyone know how to or be able to point me to a resource that explains how to load these in R? I wish to lemmatise them and extract collocations (nearest neighbours) within a term with a window size of 3 + their counts per corpus + proportion (count of collocate/ total tokens in corpus).

Any resources/ tips would be much appreciated. It might be a simple solution. I am completely new to handling corpus data, but have tried the below code so far which did not work:

corpus <- load.corpus("corpus1.txt")
  • 1
    $\begingroup$ This is a resource which explains how to do standard preprocessing. Extracting colocations with a sliding window is more advanced, I don't know if there's a library so you might have to code it yourself. $\endgroup$
    – Erwan
    May 11, 2021 at 9:27
  • $\begingroup$ Thank you very much, @Erwan! $\endgroup$
    – n.baes
    May 12, 2021 at 9:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.