FreeLanguageTools / vocabsieve

Simple sentence mining tool for language learning
GNU General Public License v3.0
344 stars 25 forks source link

Word field improvements #111

Closed artjomsR closed 6 months ago

artjomsR commented 6 months ago

Partially fixes https://github.com/FreeLanguageTools/vocabsieve/issues/107 by setting the contents of Word field with whatever was searched if both dict groups return nothing.

There's still a scenario where target is not found in the 1st group but found in the 2nd. Currently, the Word field mirrors whatever is defined in the 1st group. To get around this, I was thinking the following: always pass word_widget to MultiDefinitionWidget. In addition, pass lookup1_result_success to MultiDefinitionWidget.setCurrentDefinition(). If lookup1_result_success == False, then set the Word field with the contents of the result of the 2nd group, assuming that something was found. Thoughts?


I've also allowed Ctrl+D to work on the Word field, to make it easier to search for words in case it didn't find the correct lemma on the 1st try

1over137 commented 6 months ago

I think the proper behavior should be: Word field changes with whatever user decides to switch to, in first or second definition field. Also, if nothing was found at all, presumably it should be populated with whatever is being looked up for convenience. What is the current behavior with this patch?

artjomsR commented 6 months ago

Current behaviour is:

This PR changes so that if neither definition1 or 2 are found, then it populates Word field with whatever the user searched for (as you say in your comment)

However, this PR doesn't address that Word field will be blank if definition2 is found