diff --git a/data/.gitignore b/data/.gitignore index 224e4a5..c674722 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1 +1 @@ -JMdict.xml +JMdict*.xml diff --git a/data/fetch.sh b/data/fetch.sh index 108f41c..d8ab9f7 100755 --- a/data/fetch.sh +++ b/data/fetch.sh @@ -6,5 +6,10 @@ wget http://ftp.edrdg.org/pub/Nihongo/JMdict.gz # Extract and delete archive gzip -d JMdict.gz +# Get date +date=`grep -m 1 -oE '' JMdict.xml | sed -E 's//\1/'` + +rm JMdict*.xml + # Add XML extension -mv JMdict JMdict.xml +mv JMdict JMdict-${date}.xml