LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading. Python/Flask.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to test dictionaries with target language text

mzraly opened this issue · comments

Is your feature request related to a problem? Please describe.

When evaluating dictionaries to add to language settings they are always tested with the input "test". It would be more useful to test with a target language word (or sentence for sentence dictionaries) to see what information the dictionary provides for target language text. Right now the test only helps verify the URL is correct and determine whether or not the dictionary can be embedded.

Describe the solution you'd like

Simplest option: a text box in the dictionary editing form that can be populated with test text that is used to replace the '###' pattern in the dictionary URL. If the text box is empty then continue to use "test". It's not a requirement to persist the dictionary test text in the database, people probably don't set up new dictionaries all that often.

Describe alternatives you've considered

Alternative 1: Same as simplest option but persist the test text in the database.

Alternative 2: Go further and add a display that shows how the test text would be parsed given the current language settings for parser, substitutions, sentence terminators, word characters, etc. That sounds like a separate ticket, lots of work, perhaps minor benefit.

A clear and concise description of any alternative solutions or features you've considered.

Additional context

None

commented

Thanks @mzraly for the details.

Your suggestion asks for a text box on the UI, and there's another issue requesting another text box ("dictionary nicknames"). Adding yet another mostly-blank text box will get crowded. Perhaps the "test" link could reveal another text box before opening the link -- I'm not sure where that would be placed. Perhaps a Javascript confirmation box would suffice:

let word = prompt("Test translation for dicturl", "test");   // substitute the url for the prompt
image

If user cancels, nothing happens, if hit ok, it does the test.

Some thoughts:

  • I'm not sure that this adds much value -- users really could/should test dictionaries outside of Lute, adding a popup like this feels like an extra unneeded step. Unless I'm missing something! Maybe there could be a Shift-click to let people try it out with extra pop-up text, so that it doesn't bother other users (me!) -- though hidden functionality is a hassle sometimes.
  • Alternative 1 implies a db schema change, code changes, etc, for something that is only going to be used once.
  • Yes, alternative 2 is a lot of work as you mentioned. Has occurred to me but will require some rework as currently Lute assumes that the parsing information is saved to the db.

LMK what you think, and the motivator for this request.

Hi @jzohrab, the motivation for the request is nothing more than what I wrote in the initial description -- evaluate the dictionary's utility with realistic text. And as you say, that can also be done outside of Lute, or by loading a book and translating a word or sentence. So it's not a big issue, just a little friction during language setup and less important than reading page improvements. But I raise issues like this in case other work where it would make sense to address them.

commented

Right, getting rid of friction is important. :-) Thanks for the issue, I'll let it sit for a while and see if I get a clever idea.