finalion / WordQuery

word fast-querying addon for anki
https://ankiweb.net/shared/info/775418273
GNU General Public License v3.0
291 stars 61 forks source link

Add stardict support #11

Closed GarrisonBaird closed 7 years ago

GarrisonBaird commented 7 years ago

There are bunches of dictionaries in stardict (.ifo) format, it will be awesome if this addon supports stardict. This won't be difficult as there are some libraries/tools already exsit and we can make use of them.

https://github.com/lig/pystardict (example) https://github.com/pysuxing/python-stardict https://dushistov.github.io/sdcv/ (non-python) https://github.com/cz7asm/pyStarDictViewer

finalion commented 7 years ago

ok, I will take it into account. But If you are interested, you can fork and pull requests. Kiitos.

GarrisonBaird commented 7 years ago

i'm working on it, using pystardict

GarrisonBaird commented 7 years ago

Here is a working version, extended WebService stardict.py

GarrisonBaird commented 7 years ago

It's very difficult to implement another MdxService, I tried for 3 hours but still couldn't make it work, but easily made it with WebService within 30 minutes. Please consider redesining the code architecture, make WebService as a general interface for all dictionaries including MdxService, WebService can do everything like MdxService does, except configuration related stuff like choosing different dictionary for each field.

finalion commented 7 years ago

@GarrisonBaird Great work! I tried it and it works!

finalion commented 7 years ago

@GarrisonBaird I have mixed your code to the newest commit and now it support stardict format. You can add stardict folders as before, then it could recognize all the dictionaries automatically.