1
yomichan-import/scripts/build_dicts.sh

44 lines
2.1 KiB
Bash
Raw Normal View History

2021-01-02 01:18:22 +00:00
#!/bin/bash
2022-07-04 03:59:33 +00:00
go get foosoft.net/projects/yomichan-import/yomichan
2021-01-02 01:18:22 +00:00
mkdir -p src
mkdir -p dst
2023-01-22 20:40:39 +00:00
function refresh_source () {
NOW=$(date '+%s')
YESTERDAY=$((NOW - 86400)) # 86,400 seconds in 24 hours
if [ ! -f "src/$1" ]; then
wget "ftp.edrdg.org/pub/Nihongo/$1.gz"
gunzip -c "$1.gz" > "src/$1"
elif [[ $YESTERDAY -gt $(date -r "src/$1" '+%s') ]]; then
rsync "ftp.edrdg.org::nihongo/$1" "src/$1"
fi
}
refresh_source "JMdict_e_examp"
yomichan -language="english_extra" -title="JMdict" src/JMdict_e_examp dst/jmdict_english_extra_with_examples.zip
2023-01-22 20:40:39 +00:00
refresh_source "JMdict"
yomichan -language="english_extra" -title="JMdict" src/JMdict dst/jmdict_english_extra.zip
yomichan -language="english" -title="JMdict (English)" src/JMdict dst/jmdict_english.zip
2021-01-02 01:18:22 +00:00
yomichan -language="dutch" -title="JMdict (Dutch)" src/JMdict dst/jmdict_dutch.zip
yomichan -language="french" -title="JMdict (French)" src/JMdict dst/jmdict_french.zip
yomichan -language="german" -title="JMdict (German)" src/JMdict dst/jmdict_german.zip
yomichan -language="hungarian" -title="JMdict (Hungarian)" src/JMdict dst/jmdict_hungarian.zip
yomichan -language="russian" -title="JMdict (Russian)" src/JMdict dst/jmdict_russian.zip
yomichan -language="slovenian" -title="JMdict (Slovenian)" src/JMdict dst/jmdict_slovenian.zip
yomichan -language="spanish" -title="JMdict (Spanish)" src/JMdict dst/jmdict_spanish.zip
yomichan -language="swedish" -title="JMdict (Swedish)" src/JMdict dst/jmdict_swedish.zip
2023-01-22 20:40:39 +00:00
yomichan -format="forms" -title="JMdict Forms" src/JMdict dst/jmdict_forms.zip
2021-01-02 01:18:22 +00:00
2023-01-22 20:40:39 +00:00
refresh_source "JMnedict.xml"
2021-01-02 01:18:22 +00:00
yomichan src/JMnedict.xml dst/jmnedict.zip
2023-01-22 20:40:39 +00:00
refresh_source "kanjidic2.xml"
yomichan -language="english" -title="KANJIDIC" src/kanjidic2.xml dst/kanjidic_english.zip
2021-01-02 01:18:22 +00:00
yomichan -language="french" -title="KANJIDIC (French)" src/kanjidic2.xml dst/kanjidic_french.zip
yomichan -language="portuguese" -title="KANJIDIC (Portuguese)" src/kanjidic2.xml dst/kanjidic_portuguese.zip
yomichan -language="spanish" -title="KANJIDIC (Spanish)" src/kanjidic2.xml dst/kanjidic_spanish.zip