forked from opencog/learn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-dict.sh
executable file
·40 lines (35 loc) · 941 Bytes
/
gen-dict.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /bin/bash
#
# gen-dict.sh
#
# Automated artificial dictionary generation. Configurable parameters
# are located in `run-config/1-dict-conf.scm`. Edit that file as desired.
#
# ---------
# Load config parameters
if [ -z $MASTER_CONFIG_FILE ]; then
echo "MASTER_CONFIG_FILE not defined!"
exit -1
fi
if [ -r $MASTER_CONFIG_FILE ]; then
. $MASTER_CONFIG_FILE
else
echo "Cannot find master configuration file!"
exit -1
fi
# ----------------------
# Step one - dictionary config file.
if ! [ -z ${GEN_CONF_FILE} ] && [ -r ${GEN_CONF_FILE} ]; then
. ${GEN_CONF_FILE}
else
echo "Cannot find dictionary configuration file!"
exit -1
fi
# Skip if the dictionary already exists
if [ -d ${DICT_DIR} ]; then
echo "Dictionary already exists; not generating a new one!"
echo "Remove ${DICT_DIR} if you want to generate a new dict."
exit -1
fi
# Generate a dictionary.
${COMMON_DIR}/gen-dict.scm ${CONFIG_DIR}/${DICT_CONF} $DICT_DIR