Fix broken JMdict downloads
Makefile
27 | 27 | ||
28 | 28 | download: | |
29 | 29 | @rm -f dictionaries/* | |
30 | - | @$(MAKE) dictionaries/JMdic_e.xml dictionaries/JMdic.xml dictionaries/frequency.tsv | |
30 | + | @$(MAKE) dictionaries/JMdict_e.xml dictionaries/JMdict.xml dictionaries/frequency.tsv | |
31 | 31 | ||
32 | 32 | # Download JMdict dictionaries from ERDRG | |
33 | 33 | dictionaries/%.xml: | |
34 | - | dl_filename="$(shell echo "$@" | rev | cut -c5- | rev)"; \ | |
35 | - | wget http://ftp.monash.edu/pub/nihongo/"$$dl_filename".gz -O "$$dl_filename.gz"; \ | |
34 | + | dl_filename="$(shell basename "$@" | rev | cut -c5- | rev)"; \ | |
35 | + | wget ftp://ftp.edrdg.org/pub/Nihongo/"$$dl_filename".gz -O "$$dl_filename.gz"; \ | |
36 | 36 | gunzip "$$dl_filename.gz"; \ | |
37 | 37 | sed -i -e 's|<|\&\<;|g' -e 's|>|\&\>;|g' "$$dl_filename"; \ | |
38 | 38 | sed -i -e 's|&\([^;]\+\);|\1|g' "$$dl_filename"; \ | |
39 | - | cp "$$dl_filename" "$@" | |
39 | + | mv "$$dl_filename" "$@" | |
40 | 40 | ||
41 | 41 | # Download frequency analysis run on Wikipedia in 2015 | |
42 | 42 | # https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists/Japanese2015_10000 |