We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/bin/bash
readonly PROG_NAME=$(basename $0) readonly PROG_DIR=$(readlink -m $(dirname $0)) readonly DIC_PATH=$PROG_DIR/.. readonly USERDIC_PATH=${DIC_PATH}/user-dic readonly MECAB_EXEC_PATH=/usr/local/libexec/mecab readonly DICT_INDEX=$MECAB_EXEC_PATH/mecab-dict-index
get_userdics() { pushd $USERDIC_PATH &> /dev/null echo $(ls *.csv) popd &> /dev/null }
gen_cost() { local input_dic=$1 echo $input_dic
$DICT_INDEX \ -m ${DIC_PATH}/model.def \ -d ${DIC_PATH} \ -u ${DIC_PATH}/user-${input_dic} \ -f utf-8 \ -t utf-8 \ -a ${USERDIC_PATH}/$input_dic
}
compile() { pushd $DIC_PATH &> /dev/null make clean;make popd &> /dev/null }
copy() { local input_dic=$1 echo $input_dic cp ${USERDIC_PATH}/$input_dic ${DIC_PATH}/user-${input_dic}
main() { echo "generating userdic..."
for dic in $(get_userdics); do gen_cost $dic done compile for dic in $(get_userdics); do copy $dic done
main
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#!/bin/bash
readonly PROG_NAME=$(basename $0)
readonly PROG_DIR=$(readlink -m $(dirname $0))
readonly DIC_PATH=$PROG_DIR/..
readonly USERDIC_PATH=${DIC_PATH}/user-dic
readonly MECAB_EXEC_PATH=/usr/local/libexec/mecab
readonly DICT_INDEX=$MECAB_EXEC_PATH/mecab-dict-index
get_userdics() {
pushd $USERDIC_PATH &> /dev/null
echo $(ls *.csv)
popd &> /dev/null
}
gen_cost() {
local input_dic=$1
echo $input_dic
}
compile() {
pushd $DIC_PATH &> /dev/null
make clean;make
popd &> /dev/null
}
copy() {
local input_dic=$1
echo $input_dic
cp ${USERDIC_PATH}/$input_dic ${DIC_PATH}/user-${input_dic}
}
main() {
echo "generating userdic..."
}
main
The text was updated successfully, but these errors were encountered: