initial commit

This commit is contained in:
lingdong huang
2020-08-06 13:32:21 -04:00
commit 86eb38d053
13 changed files with 524 additions and 0 deletions

25
setup.sh Normal file
View File

@@ -0,0 +1,25 @@
echo "downloading the dictionary..."
curl https://blog.xjpvictor.info/wp-content/uploads/汉典.prc > zdic.prc
cd tools
echo "downloading dependencies..."
git clone https://github.com/kroo/mobi-python
cp -r mobi-python/mobi ./mobi
rm -rf mobi-python
echo "patching bugs in dependencies..."
chmod +x patch.py
./patch.py
echo "converting dictionary to txt... (this might take a while ~10 mins)"
chmod +x to_txt.py
./to_txt.py > ../zdic.txt
echo "converting txt to json..."
mkdir ../zdic_json
chmod +x to_json.py
./to_json.py
echo "done setting up!"
echo "to use the app, either run 'pkg .' to package into a binary, or run 'node index.js' directly."