From f9bc1db3284f2bf05f7b1cf55ab912363c6e8440 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 19 Sep 2019 00:17:16 +0300 Subject: Use variables as much as possible --- get_data.sh | 1 + get_embeddings.sh | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/get_data.sh b/get_data.sh index 2d04678..4f97ad5 100755 --- a/get_data.sh +++ b/get_data.sh @@ -67,6 +67,7 @@ mv "${ROOT}"/*.def "${READY}" echo "Downloading dictionaries" DICT="${ROOT}/dictionaries" +mkdir -p "${DICT}" wget -nc -q https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/dic/en-sq.dic.gz -P "${DICT}" # English - Albanian wget -nc -q https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/dic/bg-en.dic.gz -P "${DICT}" # Bulgarian - English diff --git a/get_embeddings.sh b/get_embeddings.sh index daf839b..47a7a8e 100755 --- a/get_embeddings.sh +++ b/get_embeddings.sh @@ -25,6 +25,7 @@ set -o errexit -o pipefail -o noclobber -o nounset ROOT="$(pwd)" EMBS="${ROOT}/embeddings" +DICT="${ROOT}/dictionaries" mkdir -p "${EMBS}" echo "Downloading embeddings" @@ -58,15 +59,15 @@ if [ ! "$(ls -A "${ROOT}/vecmap/")" ]; then echo "VecMap directory seems empty, did you run git submodule init && git submodule update?"; exit fi -if [ ! -d "${ROOT}/dictionaries" ]; then +if [ ! -d "${DICT}" ]; then echo "Dictionaries directory does not exist, did you run ./get_data.sh?"; exit fi -if [ ! "$(ls -A "${ROOT}/dictionaries/")" ]; then +if [ ! "$(ls -A "${DICT}")" ]; then echo "Dictionaries directory seems empty, did you run ./get_data.sh?"; exit fi -TRAIN_DIC_DIR="${ROOT}/dictionaries/train" +TRAIN_DIC_DIR="${DICT}/train" MAP_TO="${ROOT}/bilingual_embeddings" mkdir -p "${MAP_TO}" -- cgit v1.2.3-70-g09d2