An alternative for Sanskrit Dictionary Updater
StarDict is a cross-platform and international dictionary software. Using StartDict or other apps that work with the StarDict dictionary format, one could use this for a dictionary of various languages.
Vishvas Vasuki (@vasukeya on Twitter) and others have compiled a nice set of dictionaries that work with StarDict compatible apps for Sanskrit, Kannada, Pali and Hindi. Thus, one could use a StarDict compatible app like GoldenDict or ColorDict which can be used for these dictionaries. The process would be to install GoldenDict and then install and run Sanskrit Dictionary Updater (again written by Vishvas) and then rescan dictionaries from within GoldenDict App.
However, I have had problems running Sanskrit Dictionary Updater on my phone recently. Hence, I just wrote this as an alternative way to download these dictionaries to your Desktop computer or to Android for myself. Note you may not need this and Sanskrit Dictionary Updater might just work for you very well. But, I needed this for myself so wrote this.
I have tested this on a OS X Yosemite 10.10.5 and on Android 4.4. While this should work with other operating systems as well that support Python 2.7, I haven't tested it.
If you don't want all the dictionaries, see section "What if I don't want Kannada or Pali files" first on how to customize the downloader.py
program that will be used.
If you want to run directly on Android, use the following steps:
- Install QPython.
- On a computer, click on downloader.py in a browser.
- Transfer this program to
/sdcard/com.hipipal.qpyplus/scripts
on Android. [You can use pushtoandroid.sh]. - Now run QPython and run the program. Be patient! It might take a while to download. It would be prudent to do this while you are connected to WiFi or have a fast internet connection. This will download and install the dictionaries on your Android phone.
- Now run GoldenDict or ColorDict and Rescan dictionaries. You are all set now!
- You already will have a Python installed on Mac. Type
python
on command line to check that. Typequit()
to exit from Python. - Clone this repository using git or just download the file downloader.py. If you don't want all the dictionaries, see the section "What if I don't want Kannada or Pali files" below.
- Type the following command in a new directory.
python downloader.py
- The .tar.gz dictionary files will get downloaded to
./sdcard/Download/dicttars
and their expansions will be put in./sdcard/Download/
.
You should have downloaded the files using the steps in previous section.
- Install GoldenDict or ColorDict some other StarDict compatible dictionary App.
- Transfer the .tar.gz files to from
./sdcard/Download/dicttars
(on Mac) to/sdcard/Download/dicttars
on Android and all files (and subdirectories) from./sdcard/Download
to/sdcard/Download
on Android. You can do this via adb or any other mechanism. - Now run GoldenDict or ColorDict and Rescan dictionaries. You should be all set now!
You should have downloaded the dictionaries as decribed in the Mac section above. This should work (I haven't tested personally. Though a friend has used Dictionary Universal and downloaded .tar.gz files directly):
- You should install a StarDict compatible app like Dictionary Universal on your iPhone.
- Download dictionaries on a Mac as given in above steps.
- Copy the .tar.gz files to your iPhone using the process described here via USB or WiFi.
I have not tested this on Windows or other platforms. But, the program should work as long as Python 2.x is available. You might want to change the paths where .tar.gz files and their expansions are stored.
Edit downloader.py and command out the index files that you don't want by putting a "#" on that line and run "downloader.py".
listOfIndexes = [
"stardict-sanskrit/master/sa-head/tars/tars.MD",
"stardict-sanskrit/master/en-head/tars/tars.MD",
# "stardict-kannada/master/en-head/tars/tars.MD",
# "stardict-kannada/master/kn-head/tars/tars.MD",
# "stardict-pali/master/en-head/tars/tars.MD",
"stardict-hindi/master/dev-head/tars/tars.MD",
]