Fix broken JMdict downloads

Julien LepillerWed Oct 02 11:30:05+0200 2019

ed52cb6

Fix broken JMdict downloads

Makefile

2727
2828
download:
2929
	@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
3131
3232
# Download JMdict dictionaries from ERDRG
3333
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"; \
3636
	gunzip "$$dl_filename.gz"; \
3737
	sed -i -e 's|<|\&\<;|g' -e 's|>|\&\>;|g' "$$dl_filename"; \
3838
	sed -i -e 's|&\([^;]\+\);|\1|g' "$$dl_filename"; \
39-
	cp "$$dl_filename" "$@"
39+
	mv "$$dl_filename" "$@"
4040
4141
# Download frequency analysis run on Wikipedia in 2015
4242
# https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists/Japanese2015_10000