[跨平台 Mac/Win/Linux] 词典APP Medict (开发者预览版)讨论

sorry if you addressed this before, I just want to ask, How is css/html rendered? it uses chrome, or behaves like chrome? put differently, if I open a page in chrome, is that how the same page will look in medict?

Hi, this app is built based on Electron framework, and the core render engine is blink (just same as chrome). Hence, it will show what you see at Chrome browser. Actually, I’ve modified some dictionary content to support page internal jumping function (add some JavaScript code to support play voice and link jumping).

In conclusion, the Medict support latest CSS standard (just like chrome supports). Besides, some HTML tags like a-link or voice play button will be enhanced (but will not affect the look like in the page)

1 个赞

nice. I look forward to trying it. css rendering is my biggest concern.

one more thing: does medict support ‘prefers-color-scheme’?

if so, is the preference based on the color scheme setting in medict, or that of the platform such as Windows? this matters to me because a PNG showing black ‘text’ and a transparent background is unreadable in dark mode, so I want it to trigger a filter on the PNG.

I know ‘prefers-color-scheme’ is broken on both MDict’s PC version and its Android app, but am unsure if that’s due to lack of browser support, or due to MDict not having an internal light/dark setting.

As your concerned point, I’ve just tested in my laptop, like this:

And the light or dark mode is decided by environment settings (windows or macOS preference). However, I can add a button to switch the dark or light mode in the content show box.

1 个赞

开源软件不是一时半会就能尽善尽美的,毕竟是义务劳动。
Linux 一开始也是规模很小,但有一堆热心人帮忙提建议、甚至写代码。
大家可以照常使用自己习惯的词典软件,但不妨有空用用Medict,反馈一下问题建议。

GoldenDict 所用的软件架构时间久远,现在缺少维护。
我是希望 Medict 在发展的过程中,能略微统一一下对mdx开源格式的规范,减少兼容性问题。
例如我手头的GoldenDict不支持 古辞辨(增订本)白话反查文言 mdd所用的tif图片,所以要解包–把tif转为jpg等格式–把jpg后缀改为tif–打包回mdd,甚是麻烦。要是有规范明说不能用这种压缩算法的tif,那大家制作mdd时就不会使用这种格式的图片。

1 个赞

Thank you for your work on this. It is no easy task!

In terms of core functionality, right now medict’s handling of @@@link is unexpected.
In my mdx, I have “滋” (U+6ECB, which does not have its own entry)redirected to both “滋”(U+2F90B)and (U+FA99):


@@@LINK=滋
</>

@@@LINK=滋
</>

in medict, the (redirected) target entries show up blank:
image

The above issue seems to be when a single search word redirects to more than one target.

Another scenario:

@@@LINK=見
</>

@@@LINK=見b
</>

medict handles the search word “见” by only showing “見b” (basically, 见@見b, while skipping the 見 entry). The proper behavior is for 见 to redirect to 見, which is a headword. in this situation, medict’s sidebar does not show the 見 entry.

If I directly look up the 見 entry, “@@@LINK=見b” actually appears as text at the bottom of the entry (instead of being treated as a redirect).

Ideally, all the relevant entries should be shown together in the search results, instead of having to select the individual tabs. In other words, it should replicate MDict’s ‘union dictionary’ behavior. (I understand this is a core design issue, and cannot be easily achieved.)

Lastly, right now medict doesn’t have ‘zoom’, either by pressing CTRL +/- or using Mouse wheel +/-. In this respect, medict does not behave like Chrome (or FireFox and IE). I often use zoom on my browser and MDict. While I design all my mdx dictionaries to display text at the default “1em” size, this is in most cases too small for me to read comfortably, so zoom is essential. Also, images that depict text often require zoom, since the displayed ‘text’ appears in various sizes, depending on the dictionary and the image.

There are also issues involving font-face, but this is a thorny problem not just for medict but for all dictionary programs.

索引问题在我本地的开发版本有一个内存索引的版本,目前查询方面问题基本已经解决,但是索引过程当中会导致界面卡死,目前还在解决这块问题。

mdd 规范方面,
我自己也遇到过发音文件格式的问题,老的mdd文件有windows专属的音频格式文件,medict 也无法解析播放,和 tif 图片的问题是一样的,medict 本身希望能够推动词典格式的不断发展和规范化。但是目前medict还有很多问题,现阶段恐难以得到大家认可,我会在业余时间不断完善Medict,等到有一定可用性和一些用户了了会尝试推动这件事情。

4 个赞

写点个人的一些想法。MacOS上自带的Dictionary.app依旧是最好的,缺点是词库少,看到喜欢的mdx词典要自己转换下。自带词典最厉害的就是所有单词,只要能查到,就都有超链,都能点击,这个查词体验实在太好了,目前其他任何词典都无法替代,不知道Medict能不能实现这一点。

  1. 很多词典都会卡死,祝早日搞定。
  2. 添加词典太繁琐了,名称、别名,这些信息都可以从MDX读取填充吧,最不济,也可以用文件名来作为默认名称,而不是必须用户手工输入。比如欧陆词典,只要拖曳、确定即可。虽然Medict就多了两步,我觉得体验特别不好。完全可以直接添加,配置里给一个界面可以修改相关信息。
  3. 编辑CSS也是大家经常会用到的,希望能增加一个右键直接编辑CSS,如果能实时预览CSS就更棒了。 Preview - 修改MDX CSS的神器,支持CSSJS实时预览
  4. 某些词条结构异常复杂,希望可以直接保存当前词典的html代码段为文件,同样便于调试。
  5. 直接集成MDX打包、解包。或单独出一个Medict专用的MDX打包工具,兼容其他词典。
  6. 从目录添加字典,nowill的GD mac版是支持的。
  7. 对英文各种变形、中文简繁、异体字的支持。为什么需要可以参考 :joy: 异体字害死人!看帖子《“這蚤晚”与“這蚤晩”相同吗?》,联想到我查询《漢語大詞典》词头时的奇葩事……
    这样就不再需要词典制作人员自己花时间处理,开发者替词典制作者、最终使用者解决问题。中文简繁、异体字列表是现成的,英文单词比较多,但常见高频单词的变形列表应该也不难搜集。
    就是默认没查到,换用各种变形试一下,或者提示一下「你要不要看下XX词库的XX词条(虽然它可能是某种异体、变形)」。
    7.支持全文检索?

希望Medict后期大体稳定了,能有一些亮点和独有的功能,否则也就是只是读个MDX,界面稍微好看点,习惯其他词典的用户可能很难转过来。

1 个赞

可以,没记错的话最早出来的chambers13就可以(好像5百多兆吧),你打开看一眼就明白了。

这个功能确实好。测试了下中日英阿拉伯语的长短句都能正确分词,不容易实现。用浏览器自带的分词功能实现的。代码在这里,最高赞就是。

1 个赞

Medict 可以支持编辑CSS并实时生效的,可以看下面的图,不知道是不是这样的需求:
Kapture 2021-10-26 at 19.55.58

1 个赞

是点bug图标吗,哈哈,和chrome调试一样,非常棒 :+1: 后面加个右键吧

我其实还不太会用Medict。现在的Medict是不是一次只能查询一个mdx?
我用惯了GoldenDict的指定几个词典作为一个Group。希望Medict在这个Group下查询就会出来包含该词头的所有mdx词条内容。

同感。我用惯了GoldenDict的添加方式,只需指定目录,后面就recursive自动。
nonwill的版本还有个选项,可以将指定目录下的每个子目录设置一个Group。这样整理各Group只需在硬盘上操作文件夹即可。当然,这样建立的Group还能手动添加词典,毕竟有些mdx希望不必存储双份就能出现在不同的Group。

这些 feature 一步一步增加吧,久久为功。
还是以词典APP为主,没必要搞个大而全,有些非核心功能以后看通过插件方式实现

多个词典的问题其实是我本人使用的时候先入为主了,我本人用的时候一般都只展开一个词典的结果,所以功能设计就成为现在这个样子了。
目前看大家其实都希望能够一次查询多个词典,这个我计划在下个版本与索引问题一同解决并支持。

2 个赞

This is actually a bug, in the next version, I’ll fix word indexing problem firstly, and after this, please try to review this problem again, thanks very much.

This point has just discussed by someone, just shown as below:

In the next version, the most top-priority things is to solve the word-indexing problem and dictionaries group feature. I think those features can end up your problems which just mentioned.

Finally, the ‘Zoom-In/Zoom-Out’ function is a tiny problem, and I am planning to fix this at a later version.

1 个赞

这个我觉得可以同全文索引一同支持,因为本身就是一个分词的过程,完成分词之后就可以实现倒排索引,先加到 TODO-list 中

2 个赞

兄台这个功能一完善,很多打着“反查”旗号的mdx生意要惨淡了哈
当然,中文的分词是关键所在。

慢慢来吧,在开发过程中打磨自己的知识结构,与开源项目一起成长

Can you make it for iOS and Android?

Technically, it’s possible, but I have to resolve Medict’s bugs first, and the js-mdict can integrated into react-native framework, which can support building IOS and Android app.

1 个赞

反馈两个问题:1. 词条列表中,目前上下键控制的是滚动条,期待的是切换词条,快速浏览。 2. 一个词条有多个entry时,不能正确显示,期待的是像其他词典那样显示为一个词条,合并释义。

1 个赞