Open gustafl opened 8 years ago
In any case, lexemes have to be stored before any inflections.
Imagine a fresh page with no highlighted or selected words, and a user with an empty dictionary. At this initial state, the form has the following parts:
#word
is replaced by the text "Click on a word" and #ipa
is hidden.When the user clicks a word in the text, the following things happen:
At this point the use may either select another word (whereby the list above is repeated for that word) or she may pick a lexical category. If she picks a lexical category, this happens:
<span class="">
(the highlight won't be visible until the selection is gone).The user may then proceed to fill in the form and press Save (it's possible that saving may be triggered by something else in the future, to give it the appearance of being automatic, but initially there will be a Save button). When the user presses Save, this happens:
We will need to persist the user's progress to allow her to continue working on the same text between sessions. I imagine data-
attributes might come in handy here.
<span class="noun" data-lexeme="132">baleine</span>
<span class="noun" data-inflection="7423">baleines</span>
The span will have either a data-lexeme
or a data-inflection
(with implict lexeme) attribute to identify the word.
There will never be a need to show two homonyms simultaneously in the form. The word in the form always refer to the word in the context it has in the text. Any conflicts must be resolved when saving to the database (when pressing Save). Whenever the user attempts to save a word that exists in the UserDictionary database with an identical spelling (or possibly identical spelling and IPA), there must be some kind of prompt, like "Do you want to update the existing word or create a new translation?"
Let an Add inflection button appear (perhaps under Add translation) when the lexeme is saved (or loaded from the database).
Here's an idea: the buttons may need to be divided into two groups of grammatical categories:
Before the lexeme is saved, only buttons relevant to the lexeme is shown, not buttons only relevant to inflections. And the buttons relevant to inflections could appear below the Add inflection button, to make the separation more obvious.
This needs some thought, because it would add another layer of complexity. Perhaps it best to wait until a later version. I don't think it's a version 0.1.0 issue.
Okay, here's some further thinking on the inflection feature:
When the user selects a word, the word may be in the root form, or it may be in an inflected form. We have no way of knowing, and we must know, so we have to ask the user. This question is best placed directly after selecting the lexical category. So let a single-select <fieldset>
appear below the selected lexical category, with two choices: Root and Inflection. Don't display the grammatical categories before the user has made this choice.
If the user clicks the Root button, the following should happen:
If the user clicks the Inflection button, the following should happen:
On Save, a Lexeme record is saved in both cases. In the second case, Inflection record is saved too.
I must also consider how to view registered words. What happens when you click a highlighted word? It must be fast and easy to switch between seeing the lexeme data and seeing the inflection data (if any) when a word has been registered. Also, you should be able to get an overview with all the registered inflections for a lexeme (even when you click a highlighted inflection).
So it seems I will need a system of views for each lexeme. One view for the lexeme, one for the currently selected inflection, and one for all inflections. You switch views using three buttons at the top of the form.
Since last time I wrote here, I have more or less decided upon adding compounds and expressions to the list of units of learning. And in order to make registering words as effective as possible, I need to keep the units as independent from each other as possible. For instance, you shouldn't have to register the constituents of a compound before registering the compound. Indeed, you shouldn't have to register the lexeme before registering the inflection. In theory, you could have an inflection stored without the link to its lexeme. In practice though, you probably want to register the lexeme at the same time you register the inflection.
One thing I want to avoid is to make registering the lexeme part of the inflection form (i.e. the form configured for inflections). Lexemes should be registered using the lexeme form and inflections using the inflection form. This tells me we need a lexeme view, not a combined lexeme/inflection view (see issue #122). This would allow the user to switch to the lexeme view when first stumbling on an inflection of an unregistered lexeme, register the lexeme, then switch back to the unified view to register the inflection. A redo last selection button would be handy here.
I'm not yet decided about how to handle inflections. I imagine that the form works with lexemes by default, but optionally handles inflections too. One solution would be an "Add inflection" button that expands the form with an inflection section where the word is filled in with the inflection from the text. This needs some thought.