-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate-mcorpus
executable file
·73 lines (58 loc) · 2.13 KB
/
generate-mcorpus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
###########################################################################
# This script will generate some own corpus, which is bigger then Silesia.
#
# ctime: /TR 2017-06-04
# mtime: /TR 2020-12-13 (chromium replaced by firefox)
###########################################################################
U=""
# Silesia compression corpus
# type: various
U="$U http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip"
# Firefox 83.0
# type: binary
U="$U https://ftp.mozilla.org/pub/firefox/releases/83.0/linux-x86_64/en-GB/firefox-83.0.tar.bz2"
# Wikipedia stuff / documentation
# type: multimedia
U="$U https://dumps.wikimedia.org/archive/2002/2002-04-18/vikio-docs.tar.gz"
# Wikipedia Dump
# type: sql
U="$U https://dumps.wikimedia.org/archive/2002/2002-04-18/wikipedia_dump_20020321.sql.gz"
# Linux Kernel v3.0.1
# type: text/code
U="$U https://mirrors.edge.kernel.org/pub/linux/kernel/v3.0/linux-3.0.1.tar.bz2"
# International Human Genome Project, chromosome #1
# type: text/dna
U="$U http://hgdownload.cse.ucsc.edu/goldenPath/hg18/chromosomes/chr1.fa.gz"
# Cisco Umbrella Popularity List, http://s3-us-west-1.amazonaws.com/umbrella-static/index.html
# type: text/urls
U="$U http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m-2017-03-08.csv.zip"
# English Wikipedia dump - enwik8.zip
# type: text/articles
U="$U https://cs.fit.edu/~mmahoney/compression/enwik8.zip"
# download corpus content
for url in $U; do
F=`basename $url`
test -f "$F" || wget "$url"
done
# cleanup
rm -rf mcorpus mcorpus.bin
mkdir mcorpus || exit
cd mcorpus
echo "Decompressing..."
unzip ../top-1m-2017-03-08.csv.zip
unzip ../silesia.zip
unzip ../enwik8.zip
zcat ../chr1.fa.gz > chr1.fa
zcat ../vikio-docs.tar.gz | tar x
zcat ../wikipedia_dump_20020321.sql.gz > wikipedia_dump_20020321.sql
bzcat ../firefox-83.0.tar.bz2 | tar x
bzcat ../linux-3.0.1.tar.bz2 | tar x
# build one single file with different and unsorted content types
# -> can be used for testing / benchmarking archivers
# /TR 2020-12-13
echo "Putting together into single file mcorpus.bin ..."
find . -type f -print0 | sort -z | xargs -r0 cat >> ../mcorpus.bin
cd ..
# name: mcorpus.bin
# bytes: 1657442978