Description Usage Arguments Details Value Note References See Also Examples
View source: R/read.corp.LCC.R
Read data from LCC[1] formatted corpora (Quasthoff, Richter & Biemann, 2006).
1 2 3 4 5 6 7 8 9 10 11 |
LCC.path |
A character string, either path to a .tar/.tar.gz/.zip file in LCC format (flatfile), or the path to the directory with the unpacked archive. |
format |
Either "flatfile" or "MySQL", depending on the type of LCC data. |
fileEncoding |
A character string naming the encoding of the LCC files. Old zip archives used "ISO_8859-1". This option will only influence the reading of meta information, as the actual database encoding is derived from there. |
n |
An integer value defining how many lines of data should be read if |
keep.temp |
Logical. If |
prefix |
Character string,
giving the prefix for the file names in the archive. Needed for newer LCC tar archives
if they are already decompressed (autodetected if |
bigrams |
Logical, whether infomration on bigrams should be imported.
This is |
cooccurence |
Logical, like |
caseSens |
Logical,
if |
The LCC database can either be unpacked or still a .tar/.tar.gz/.zip archive. If the latter is the case, then all necessary files will be extracted to a temporal location automatically, and by default removed again when the function has finished reading from it.
Newer LCC archives no longer feature the *-meta.txt
file,
resulting in less meta informtion in the object.
In these cases, the total number of tokens is calculated as the sum of types' frequencies.
An object of class kRp.corp.freq
.
Please note that MySQL support is not implemented yet.
Quasthoff, U., Richter, M. & Biemann, C. (2006). Corpus Portal for Search in Monolingual Corpora, In Proceedings of the Fifth International Conference on Language Resources and Evaluation, Genoa, 1799–1802.
[1] https://wortschatz.uni-leipzig.de/en/download/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# old format .zip archive
my.LCC.data <- read.corp.LCC(
file.path("~","mydata","corpora","de05_3M.zip")
)
# new format tar archive
my.LCC.data <- read.corp.LCC(
file.path("~","mydata","corpora","rus_web_2002_300K-text.tar")
)
# in case the tar archive was already unpacked
my.LCC.data <- read.corp.LCC(
file.path("~","mydata","corpora","rus_web_2002_300K-text"),
prefix="rus_web_2002_300K-"
)
freq.analysis(
tokenized.obj,
corp.freq=my.LCC.data
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.