jiehong / zhudi Goto Github PK
View Code? Open in Web Editor NEWZhudi is a graphical interface to xDICT range of free dictionaries written in GTK4
License: GNU Lesser General Public License v3.0
Zhudi is a graphical interface to xDICT range of free dictionaries written in GTK4
License: GNU Lesser General Public License v3.0
Currently, the landing tab when launching the application is the one that should be called "About".
It was historically a first greeting pane, but it's adding 1 click every time the app is launched, which is not satisfactory.
As far as I can tell, pinyin searching doesn't work. Searching "ni" obviously crashes everything, but nihao, ni3, and nǐ don't work.
Basically the title. No idea how hard it would be though!
Do you like header bar applications?
For example,
Characters with multiple meanings, e.g. 年, will only be shown the first definition. In this case is 1. surname Nian, which isn't very helpful.
I know there are good instructions in the README but I feel it could be still more user-friendly.
Coming bundled with cedict/cfdict would be better than nothing imo, but you might disagree. One plus is that updating zhudi would then be an easy way for me to update the dictionaries :P
Even having to first split the dictionary into bits would be better if it was seamless on first run. Something like running zhudi -s mydict
could do the splitting, put the files in ~/.zhudi
instead of current directory, and then startup zhudi normally.
Maybe then it would be difficult to support multiple different dictionaries (e.g. both cfdict and cedict)? I think it could be made to work nicely. Let me know if you're interested and I'll make an attempt.
E.g. in 年 we have 2. CL:個|个[ge4]
I think it should be "gè" instead of "ge4" (if pinyin selected) or ㄍㄜˇ if zhuyin selected.
Hopefully this could be accomplished by just pointing the pinyin/zhuyin converter at parts of the definitions contained within square brackets.
Zhudi sometimes cores, when latin input is too short.
Ex: (cfdict.u8), word entered: "si":
(zhudi_gui.py:7479): Gtk-CRITICAL **: gtk_text_buffer_get_iter_at_mark: assertion 'GTK_IS_TEXT_MARK (mark)' failed
(zhudi_gui.py:7479): Gtk-CRITICAL **: gtk_text_layout_get_line_yrange: assertion '_gtk_text_iter_get_btree (iter) == _gtk_text_buffer_get_btree (layout->buffer)' failed
(zhudi_gui.py:7479): Gdk-ERROR **: The program 'zhudi_gui.py' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
(Details: serial 10020 error_code 11 request_code 130 (MIT-SHM) minor_code 5)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
/usr/bin/zhudi: line 3: 7479 Trace/breakpoint trap (core dumped) $(dirname $0)/zhudi_gui.py $@
This is a bit subjective, but I think it would be better if the search bar had cursor focus when zhudi starts.
This would be better because you wouldn't have to click inside the search bar before you start typing.
Even better would be if the search bar never lost focus (in the "Dictionary" tab), even if you click on an entry. Then you could always type and the search bar would pick it up.
setup does prepare some files but crashes.
$ zhudi -s cfdict.u8
Splitting dictionary in progress…
Traceback (most recent call last):
File "/usr/bin/zhudi_gui.py", line 5, in
pkg_resources.run_script('zhudi==1.4', 'zhudi_gui.py')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 483, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1348, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 43, in
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 30, in main
File "build/bdist.linux-x86_64/egg/zhudi/init.py", line 74, in prepare_data
TypeError: init() takes at least 11 arguments (8 given)
below is only there if helpful.
or does it only leave incorrectly? if I run from the same directory (yes i did the awful way, everything in the same place ;)
$ ls
build cfdict.u8 COPYING.tex dist doc NEWS pinyin PKGBUILD README.md scripts setup.py simplified tests.py traditional translation zhudi zhudi-data zhudi.egg-info zhudi.install
running zhudi will then fail
$ python /usr/bin/zhudi_gui.py -p pinyin -tr translation -sd simplified
No config file found. Use defaults
Traceback (most recent call last):
File "/usr/bin/zhudi_gui.py", line 5, in
pkg_resources.run_script('zhudi==1.4', 'zhudi_gui.py')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 483, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1348, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 43, in
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 30, in main
File "build/bdist.linux-x86_64/egg/zhudi/init.py", line 143, in prepare_data
File "build/bdist.linux-x86_64/egg/zhudi/chinese_table.py", line 56, in load
IOError: [Errno 2] 没有那个文件或目录: '/usr/share/zhudi-data/cangjie5'
ok so let's go installing zhudi-data.
$ sudo cp -R zhudi-data /usr/share/
$ zhudi -p pinyin -tr translation -sd simplified
No config file found. Use defaults
Traceback (most recent call last):
File "/usr/bin/zhudi_gui.py", line 5, in
pkg_resources.run_script('zhudi==1.4', 'zhudi_gui.py')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 483, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1348, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 43, in
File "/usr/lib/python2.7/site-packages/zhudi-1.4-py2.7.egg/EGG-INFO/scripts/zhudi_gui.py", line 30, in main
File "build/bdist.linux-x86_64/egg/zhudi/init.py", line 152, in prepare_data
UnboundLocalError: local variable 'simplified' referenced before assignment
The first time you start zhudi, it will render pinyin with numbers instead of tones, even though in the options tab "pinyin" is the selected method. Once you click on the pinyin option again it seems to notice and start rendering pinyin properly.
Possibly this has something to do with the ~/.zhudi/config file that gets created.
This one might just be my computer being weird. If I change to the options tab and click either of the options, the lists flash instead of coming up normally. On the second click within the tab they work as they should.
This happens 50% of the time, not all the time. No idea why.
Currently, config and data are stored in "$HOME"/.zhudi
, but zhudi should follow http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html instead.
When I press down in the dictionary, the selection can go off the bottom of the screen and the scrolling window doesn't follow. So I can't see what I'm about to select.
Sorry for submitting lots of issues. These are the sort of things I would like to make pull requests for, please let me know if you will accept them. :)
The option button needs to be re-designed.
My current idea is to merge it into the About tab, and rename that tab on the way.
When searching in Chinese, results are ordered by length (and for the same length, ordered somehow I guess?) which makes sense.
I think it would be helpful if the results were also sorted by length for English searches too.
Even better would be if they were ordered by commonness somehow, but that would probably be quite difficult.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.