-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (46 loc) · 1.69 KB
/
Makefile
File metadata and controls
57 lines (46 loc) · 1.69 KB
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
all: \
autogenerated_iso639.go \
autogenerated_iso639_en_names.go \
autogenerated_iso639_nat_names.go \
autogenerated_cp1252.go \
test_data/wikipedia/auto_en.txt \
autogenerated_trigrams_en.go \
P=langdetect
autogenerated_trigrams_en.go:
echo This needs hand tweaking
false
autogenerated_common_words.go: common_words/*
(cd common_words && go run common_words.go) > $@.tmp
mv $@.tmp $@
autogenerated_iso639.go:
echo package $P > $@
echo >>$@
echo 'var (' >>$@
cat iso639.raw | cut -f1 | perl -pe "\$$c=\$$c+0;s/^(\w)(\w)/ \u\\1\\2 = Language{[2]byte{'\\1','\\2'},\$$c,0}/;\$$c++" >>$@
echo ')' >>$@
echo -n 'var lcodesString = "' >>$@
cat iso639.raw | cut -f1 | perl -pe 'chomp'>>$@
echo '"'>>$@
autogenerated_iso639_en_names.go:
echo package $P > $@
echo >>$@
echo "var langEnglish = [...]string{" >>$@
cat iso639.raw | cut -f1,3 | perl -pe '$$c=$$c+0;s/^(\w\w)\t(.+)/\u$$c:"$$2",/;$$c++' >>$@
echo "}">>$@
autogenerated_iso639_nat_names.go:
echo package $P > $@
echo >>$@
echo "var langNative = [...]string{" >>$@
cat iso639.raw | cut -f1,4 | perl -pe '$$c=$$c+0;s/^(\w\w)\t(.+)/\u$$c:"$$2",/;$$c++' >>$@
echo "}">>$@
autogenerated_cp1252.go: bestfit1252.txt
echo package $P > $@
echo >>$@
echo "var cp1252 = smallhalfencoding{" >>$@
egrep '^0x[[:alnum:]]{2}[[:space:]]' bestfit1252.txt|cut -f2|tail -128|sed -e 's/\r//;s/$$/,/' >>$@
echo "}">>$@
test_data/wikipedia/auto_en.txt: test_data/wikipedia_languages.txt
mkdir -p test_data/wikipedia
for L in `cat test_data/wikipedia_languages.txt`; do echo Fetching wikipedia front page in $$L;lynx -dump -nolist https://$${L}.wikipedia.org/ >test_data/wikipedia/auto_$${L}.txt ; done
clean:
rm -f autogenerated_* test_data/*/auto_*