-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
73 lines (55 loc) · 1.63 KB
/
build.sh
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/bash
# Generating Wordlists
mkdir -p build
rm -f build/*.txt
TARGET=v1
mkdir -p ${TARGET}
rm -f ${TARGET}/*
for wlfile in $(echo sources/**/generated/*.txt);
do
filename=$(basename $wlfile)
cat $wlfile >> "build/$filename"
done
for wlfile in $(echo build/*.txt);
do
filename=$(basename $wlfile)
case $filename in
adjective.txt | adverb.txt | article.txt)
cat $wlfile | grep -vE '[…’\.\(]' | sort -u > "${TARGET}/$filename"
;;
affix-prefix.txt)
cat $wlfile | grep -E '^.*-$' | sort -u > "${TARGET}/$filename"
;;
affix-suffix.txt)
cat $wlfile | grep -E '^-' | tr '.…' '-' | tr -s '-' | grep '^-' | sort -u > "${TARGET}/$filename"
;;
comparative.txt)
cat $wlfile | grep -vE '^-' | sort -u > "${TARGET}/$filename"
;;
expression-multi-word.txt)
cat $wlfile | grep -v 'à' | sort -u > "${TARGET}/$filename"
;;
interjection.txt)
cat $wlfile | grep -vE '[à’,]' | tr -d '!' | sort -u > "${TARGET}/$filename"
;;
noun-das.txt | noun-der.txt | noun-die.txt)
cat $wlfile | grep -vE '^\.|[…\*\+\ǃ’„“§]' | sort -u > "${TARGET}/$filename"
;;
noun-plural.txt)
cat $wlfile | grep -vE '…|\(' | sort -u > "${TARGET}/$filename"
;;
number-cardinal.txt | number-ordinal.txt)
cat $wlfile | grep -vE '^\.|…' | sort -u > "${TARGET}/$filename"
;;
particle.txt)
cat $wlfile | grep -vE '^\.|[\.-]$|[…à]' | sort -u > "${TARGET}/$filename"
;;
verb.txt)
cat $wlfile | grep -vE '^\.|…' | tr -d '()' | sort -u > "${TARGET}/$filename"
;;
*)
cat $wlfile | sort -u > "${TARGET}/$filename"
;;
esac
done
tar cvzf build/wordlists.tar.gz v1/*.txt README.md LICENSE