LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading.
https://luteorg.github.io/lute-manual/
MIT License
492 stars 46 forks source link

Zero width space symbol is copied everywhere with multi-word term #502

Closed sergatgh closed 1 week ago

sergatgh commented 4 weeks ago

Description

When I create multi-word term it automatically adds zero width space which is annoyingly copied everywhere including Anki.

To Reproduce

Steps to reproduce the behavior, e.g.:

  1. Go to 'Terms'
  2. Click on 'Actions' -> 'Create New'
  3. Enter multi-word 'Term' and 'Translation' and hit Save
  4. Return to 'Terms' list and find newly created term, click on it
  5. Copy the value in 'Term' input and paste it in 'Developer Console'

Actual Result: Zero width space symbol is copied along with the term. When importing to Anki zero width spaced copied. Expected Result: Term is copied without extra symbols. When importing to Anki only term is copied.

weird-symbols

image

Extra software info, if not already included in the Description:

jzohrab commented 4 weeks ago

Hi @sergatgh, thanks for the issue! Lute has to add those zero-width spaces as part of how it processes data -- I started investigating removing it in the term form etc but it's actually not possible, as some languages change their parsing depending on context. It's a tough problem.

How do you export data for use in Anki? The ZWSs should be removed in any exports, I don't think they are yet. That's going to cause other issues for people who export and import data into different Lute instances, potentially, so I'll need to clarify that somehow, not sure just yet.

Cheers!

sergatgh commented 4 weeks ago

Hello @jzohrab Thank you for the answer.

As an Anki importer I'm using this plugin: https://ankiweb.net/shared/info/731717372

To install it on Anki desktop version you have to open Anki -> click Tools -> Add-ons -> Get Add-Ons... -> enter 731717372 -> click OK and restart Anki. Then Tools -> "LUTE to Anki Importer" allows to select "lute.db" file which I get from lute website by clicking Backup -> Create Backup, then I unpack archive with database and rename it. Here is a little demo:

anki-demo

jzohrab commented 4 weeks ago

Ah that's cool, I wasn't aware of that plugin. The plugin should be aware of how Lute stores its data, I don't have a "human-friendly" field in the db. I've messaged the creator of the add-in to let him/her know that the zero-width space should be removed during the process. This is outside of Lute's control with this add-in, so there's not much I can do on this end, but hopefully the add-in author will see it and update the add-in. I also pinged the discord user, and will keep this open to keep an eye on it.

There's an old issue for anki exports, #3, to be build into Lute, but I haven't started it due to everything else.

jzohrab commented 1 week ago

I've messaged the add-on author, that should be updated, it's outside of my control. :wave:

sergatgh commented 1 week ago

@jzohrab Thank you for your help, I saw the update (I still have some questions 🙈), but the good part is that it's a python script that I was able to quickly modify for my needs and respect to the author for that plugin and a good code structure. Unfortunately I do not have discord and don't know how to use it, but I hope to register soon to reach the author with my suggestions. Also will be waiting for the importer integrated in lute 🤗 that will be super-helpful, thank you!