Skip to content

Commit

Permalink
download latest dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
hayashi_mas committed Jan 22, 2024
1 parent 1e5ad9a commit 54c9d40
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions fetch_dictionary.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/bin/sh

DICT_NAME_BASE="sudachi-dictionary-20220519"
DICT_TYPE="core"
DICT_NAME="${DICT_NAME_BASE}-${DICT_TYPE}"
DICT_VERSION=${1:-"latest"}
DICT_TYPE=${2:-"core"}

DICT_NAME="sudachi-dictionary-${DICT_VERSION}-${DICT_TYPE}"

echo "Downloading a dictionary file \`${DICT_NAME}\` ..."
echo

curl -L \
http://sudachi.s3-website-ap-northeast-1.amazonaws.com/sudachidict/${DICT_NAME}.zip \
https://d2ej7fkh96fzlu.cloudfront.net/sudachidict/${DICT_NAME}.zip \
> ${DICT_NAME}.zip

unzip ${DICT_NAME}.zip
unzip -j ${DICT_NAME}.zip -d ${DICT_NAME}

mv ${DICT_NAME_BASE}/system_${DICT_TYPE}.dic resources/system.dic
mv ${DICT_NAME}/system_${DICT_TYPE}.dic resources/system.dic

rm -rf ${DICT_NAME}.zip ${DICT_NAME_BASE}
rm -rf ${DICT_NAME}.zip ${DICT_NAME}

echo
echo "Placed a dictionary file to \`resources/system.dic\` ."

0 comments on commit 54c9d40

Please sign in to comment.