cschiller / zhongwen

Official source code of the "Zhongwen" Chrome extension
https://chrome.google.com/webstore/detail/zhongwen-chinese-english/kkmlkkjojmombglmlpbpapmhcaljjkde
GNU General Public License v2.0
312 stars 52 forks source link

Changing definitions in cedict_ts.u8 has side effects #80

Closed metzkorn closed 3 years ago

metzkorn commented 3 years ago

I was trying to change the English definitions to Chinese definitions (because immersion) and noticed it breaks the app. Steps to reproduce: change a definition in cedict_ts.u8.

image image

Why is that? I don't understand why the definitions would cause other searches to fail?

Hopefully Christian (or someone) can answer this before I spend a lot of time staring at the source code to figure it out myself. I saw a fork that added some Vietnamese definitions, maybe they found a workaround.

metzkorn commented 3 years ago

The indices track the positions of the characters in the text. It's not based on lines at all. Updating definitions requires updating indices .-. 有点麻烦