Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposing a simple means to cover various word forms from a button action #254

Closed
jamjolu opened this issue Mar 25, 2023 · 57 comments · Fixed by #367
Closed

Proposing a simple means to cover various word forms from a button action #254

jamjolu opened this issue Mar 25, 2023 · 57 comments · Fixed by #367
Labels
Milestone

Comments

@jamjolu
Copy link

jamjolu commented Mar 25, 2023

I closed my own issue, #252 by accident (my own Github ignorance.) It is just as well as the suggestion by Klues led me to this proposal instead.
I propose a button action that would permit users to toggle through various word forms for verbs, nouns, and adjective/adverbs.
As Klues proposed a new tab in the button editing box called "grammar" into which one could record various verb conjugations and inflections, singular/plural noun forms, adjectival or adverbial alternatives etc.. I propose a more generic "word forms" tab that would be independent of grammar.
Examples:
be am is are being was were been
box boxes
hot hotter hottest

It could also function as a way to toggle through members of a related set:
(positive, comparative, superlative) - good better best
(sibling names) - John Mary Bob Mike

The Word Forms tab would would allow user's to record the set of word alternatives.
The element action would index over the set of alternatives based on the last entry in the Collection element and replace the last element if an alternative exists.
A button element with more than one word form could have a small + on it (similar to the small box for links) to denote the existence of word alternatives.

Please check out #252 for a more complete discussion.
Thanks,
jl

@klues
Copy link
Contributor

klues commented Mar 27, 2023

I think it should be possible to reopen an issue, if you've closed it, but don't worry.

Thanks for the new proposal. I like it, since it's very generic and can be used in very flexible ways. Therefore it's fitting with the general idea of AsTeRICS Grid to be as flexible as possible for many use cases.

I think of the following extensions of your proposal:

  • we could provide an optional possibility to add something like tags or a label to word forms. So it could be used in a generic way (like for sibling names) or for something like verb conjugations, where each word form could have a label like this:

    • "am" 1.PS
    • "are" 2.PS
    • "is" 3.PS ...

    Then we could add an action "change word form to" to any element and e.g. add it to an element containing "I" with "change word form to 1.PS" changing all words of the grid to word form "1.PS" (if existing). In that way some kind of grammar could be modelled within the configuration without having to add explicit grammar rules for a specific language.

  • for verbs we could still use a way to import conjugations (and automatically add the labels) using the API from verbix.com

  • I think some kind of popup shown by a separate action that shows all existing word forms would also be great. So e.g. "normal tap" = select element with current word form, "long tap" = show popup with all exsting alternatives, making it possible to directly select one. Although we would have to think about how to make this accessible if alternative input options like scanning are used.

@jamjolu
Copy link
Author

jamjolu commented Mar 27, 2023 via email

@ms-mialingvo
Copy link
Collaborator

ms-mialingvo commented Dec 17, 2023

I'm working on a board set that works for different languages. We've already discussed some things, Benjamin, here now some specific examples.

Sign explanation:
"xxx" = normal button, speaks xxx
** zzz ** = Grammar button, content is not spoken, changes the text of button "xxx" to 'yyy'. Functions summable.

Sentence: You (plural, feminine) aren't doctors.

English:
click "You"
click ** 2nd person plural ** changes all verbs to 2nd person plural, including "be" to 'are'
click 'are'
click "not" => are + not merge in the speaking bar to aren't
click ** plural (nominative) ** changes all words to plural, including "doctor" to 'doctors'
click 'doctors'.

German:
click "Ihr"
click ** 2nd person plural **, changes "be" to 'seid'
click 'seid'
click ** feminine (nominative, singular) ** (+ click ** plural (nominative) ** but it's the same form in German) changes "kein" to 'keine'
click 'keine'
click ** feminine (nominative, singular) ** + click ** plural (nominative) ** changes "Arzt" to 'Ärztinnen'
click 'Ärztinnen'

French:
click "Vous"
click "non"
click ** 2nd person plural ** changes "être" to 'êtes'
click 'êtes' => non + êtes merges to n'êtes in the speaking bar
click "pas"
click "des"
click ** plural (nominative) ** changes "docteur" to 'docteurs'
click 'docteurs'

Turkish:
click "doktor"
click "değil (not)"
click ** 2nd person plural ** changes "olmak (to be)" to... '-siniz'(?)
click '-siniz' => değil + -siniz merge to değilsiniz in the speaking bar

(?) Means that I'm not sure which if any changed word the button "olmak" should show after clicking the grammar button, because the wordform depends on the previous word and while you've told me it would be possible to make word changes in the speaking bar according to the previous word (like with are + not => aren't), I could imagine that making already the button show a specific word depending on the word in the speaking bar would be additionally tricky to code? Like after clicking "are" the "not"-button automatically changing to "n't"? As an example for the ending differences in Turkish: "You are doctors" would be
click "doktor"
click ** 2nd person plural ** changes "olmak (to be) to '-siniz'(?)
click '-siniz' => doktor + -siniz merge in the speaking bar to the correct form 'doktorsunuz'

@klues klues added this to the Netidee milestone Dec 19, 2023
@klues
Copy link
Contributor

klues commented Dec 29, 2023

click "You"
click ** 2nd person plural ** changes all verbs to 2nd person plural, including "be" to 'are'

That's the basic form how actions could change word forms which I have in mind. However it would also be possible to attach the action to change to ** 2nd person plural ** to the "You" button, so that there is no need to click an extra button for that. But it also will be possible with the extra button.

click "not" => are + not merge in the speaking bar to aren't

I think that will be possible if the ** not ** button also is a button which changes the word form, like ** 2nd person plural ** before. So it will change all word forms (where existing) to the form labelled with NEGATION. And therefore it could also change words in the collection bar to this NEGATION form, which has to be added within the original button for "is/are/aren't". However in this case we'll need a system where it's possible to add multiple labels to word forms like this:

  • 1.P -> am
  • 2.P -> are
  • 3.P -> is
  • 1.P, NEGATION -> "am not"
  • 2.P, NEGATION -> "aren't"
  • 3.P, NEGATION -> "isn't"

So then the first button ** 2nd person plural ** selects the first word form with label 2.P ("are") and the ** not ** button will then additionally select NEGATION, so that in total it will select 2.P + NEGATION = "aren't".

To consider here:

  • a button which writes "not" to the bar and the one which selects the NEGATION form probably will have to be 2 different buttons. Otherwise it will be difficult to know when to add "not" to the bar and when to change the last word to NEGATION form. Maybe it's possible to only add "not" if the last word in the bar wasn't changed - but this is something which needs more evaluation.
  • for me it's not entirely clear when to "collect" tags like in the example before, so first 2.P and then NEGATION and when to not collect / start with a new collection of tags. E.g. if you do:
    • click ** 2nd person plural ** changes all verbs to 2nd person plural, including "be" to 'are'
    • click 'are'
    • click ** feminine ** - changes all adjectives (spanish) to feminine form
    • here it's the question how the program knows, that in this case we don't want to collect the tags 2.P and FEMININE and apply it to the selected word are. But maybe it's ok to try to apply it and simply discard it, if the tag FEMININE is not available on the word are.

click 'êtes' => non + êtes merges to n'êtes in the speaking bar

This is different from "are" to "aren't" in the example before since "non" was first. I think in this case the user would have to select "êtes" first and afterwards click ** not ** in order to apply the NEGATION. Or another possibility is that the ** non ** button doesn't write something to the bar and just changes "êtes" to "n'êtes" in the grid, which then can be selected.

click ** 2nd person plural ** changes "olmak (to be)" to... '-siniz'(?)
click '-siniz' => değil + -siniz merge to değilsiniz in the speaking bar

I think I don't fully understand this example. However I think "değilsiniz" probably should be a word form of "olmak", also with the tags 2.P (or 2.PPLURAL if plural is different) and NEGATION. Then the same as for the previous example applies, either "olmak" could be written first and then can be changed using ** not ** and ** 2nd person plural ** or the other way around (first change the form within the grid, then add it to the bar). I think like in the french example "değil (not)" shouldn't be written to the bar before, since it shouldn't be existing as a separate word in the final sentence, but it's determining the word form of "olmak (to be)".

@ms-mialingvo
Copy link
Collaborator

ms-mialingvo commented Dec 29, 2023

That's the basic form how actions could change word forms which I have in mind. However it would also be possible to attach the action to change to ** 2nd person plural ** to the "You" button, so that there is no need to click an extra button for that. But it also will be possible with the extra button.

So then it would show "You" and "are" in the bar? One thing that speaks against that is that "are" might be need to be used without "you" previously, like in questions (Are you tired?) but if this could also be possible, that's good to know.

  • for me it's not entirely clear when to "collect" tags like in the example before, so first 2.P and then NEGATION and when to not collect / start with a new collection of tags. E.g. if you do:

    • click ** 2nd person plural ** changes all verbs to 2nd person plural, including "be" to 'are'
    • click 'are'
    • click ** feminine ** - changes all adjectives (spanish) to feminine form
    • here it's the question how the program knows, that in this case we don't want to collect the tags 2.P and FEMININE and apply it to the selected word are. But maybe it's ok to try to apply it and simply discard it, if the tag FEMININE is not available on the word are.

I'd assume that if the user clicks a "wrong" combination (like ** 2nd person plural ** + ** feminine ** for an English verb) then it doesn't matter if other fields change. As long as everything resets once a "normal word"-button is clicked.

  • a button which writes "not" to the bar and the one which selects the NEGATION form probably will have to be 2 different buttons. Otherwise it will be difficult to know when to add "not" to the bar and when to change the last word to NEGATION form. Maybe it's possible to only add "not" if the last word in the bar wasn't changed - but this is something which needs more evaluation.

click 'êtes' => non + êtes merges to n'êtes in the speaking bar

This is different from "are" to "aren't" in the example before since "non" was first. I think in this case the user would have to select "êtes" first and afterwards click ** not ** in order to apply the NEGATION. Or another possibility is that the ** non ** button doesn't write something to the bar and just changes "êtes" to "n'êtes" in the grid, which then can be selected.

Okay, so I guess then some kind of conditional programming "if last word in bar is xxx, replace it with xyy after clicking this button" is not possible or difficult to program?

click ** 2nd person plural ** changes "olmak (to be)" to... '-siniz'(?)
click '-siniz' => değil + -siniz merge to değilsiniz in the speaking bar

I think I don't fully understand this example. However I think "değilsiniz" probably should be a word form of "olmak", also with the tags 2.P (or 2.PPLURAL if plural is different) and NEGATION. Then the same as for the previous example applies, either "olmak" could be written first and then can be changed using ** not ** and ** 2nd person plural ** or the other way around (first change the form within the grid, then add it to the bar). I think like in the french example "değil (not)" shouldn't be written to the bar before, since it shouldn't be existing as a separate word in the final sentence, but it's determining the word form of "olmak (to be)".

It would be an advanced version of the previously mentioned question.
"1.) change this (verb)-button to 2.P after selecting the grammar-button for ** 2.P **
2.) if last word in bar is xxx, replace it with x2z after clicking this now conjugated (verb-)button"
respectively
"1.) change this (verb)-button to 1.P after selecting the grammar-button for ** 1.P **
2.) if last word in bar is xxx, replace it with x1w after clicking this now conjugated (verb-)button"

The suggestions you've made would also work and I can think of other options too, but purely from the view of how the word would be produced and formed verbally, in the case of Turkish left-to-right, that would be the optimal solution so I want to check if that's possible and if not.

@jamjolu
Copy link
Author

jamjolu commented Dec 29, 2023 via email

@klues
Copy link
Contributor

klues commented Jan 2, 2024

So then it would show "You" and "are" in the bar? One thing that speaks against that is that "are" might be need to be used without "you" previously, like in questions (Are you tired?) but if this could also be possible, that's good to know.

I think all of this should be possible:

  • simple button "You", only adds "You" to the bar (like now)
  • button "You", which adds "You" to the bar, but at the same time has an action like ** change to 2.PP ** which changes the word forms of other elements to a specific label like 2.PP, so changing "is" to "are".
  • an extra button with label "Change to 2. Person plural" which also changes other words to 2.PP, but doesn't add anything to the bar.

So the user should be as flexible as possible to create a solution that fits best for a use case.

As long as everything resets once a "normal word"-button is clicked.

Yes, that's where I'm not completely sure, when to reset the collection of tags in the background. But yes, probably if any element without an "change word form"-action is selected. Maybe also if the collected tags like 2.P and FEMININE aren't existing for any element.

Okay, so I guess then some kind of conditional programming "if last word in bar is xxx, replace it with xyy after clicking this button" is not possible or difficult to program?

Nearly everything you can imagine is possible to program ;)
However for me the goal is to create a system that's as easy and at the same time as flexible as possible. So if the goal to change "êtes" to "n'êtes" is reachable using the existing idea (like I've described it) - I think it's not good to add additional logic, which will probably confuse many users.

The suggestions you've made would also work and I can think of other options too, but purely from the view of how the word would be produced and formed verbally, in the case of Turkish left-to-right, that would be the optimal solution

click "doktor"
click "değil (not)"
click ** 2nd person plural ** changes "olmak (to be)" to... '-siniz'(?)
click '-siniz' => değil + -siniz merge to değilsiniz in the speaking bar

So if it's about the order of clicking, I think this should be possible with the proposed system:

  • click "doktor"
  • click ** change to NEGATION ** - doesn't add something to the bar, but changes all word forms to NEGATION, so "olmak" to "(not) olmak" (whatever the base form of negation is here)
  • click ** 2nd person plural ** changes "(not) olmak" to "değilsiniz"
  • click the element now showing "değilsiniz" (which was "olmak" at the beginning) to add it to the bar

In this example "değilsiniz" is stored and defined as a word form of "olmak" with tags 2.PP and NEGATION which is intuitive and understandable. If I would have to define any rule like "değil" + "olmak" + "2.PP" = "değilsiniz" it wouldn't be so clear where to define this and therefore probably more confusing for the user.

@klues
Copy link
Contributor

klues commented Jan 2, 2024

Thanks @jamjolu for your thoughts!

I think your ideas could also be integrated or be a special form of the approach with tags I'm discussing with @msantos-87.

I --> am (what about the possibility of "will", "was" ?)

Here it could be possible to define word forms of and elment with the base form "be" like this:

  • 1.P, INFINITIVE: "am"
  • 1.P, PAST: "was"
  • 1.P, FUTURE: "will be"

Then there could be an action like ** change to 1.P ** on the element "I", so clicking on on it adds "I" to the bar and at the same time changes "be" to the first word form including 1.P = "am" in the grid. Then at the "be" ("am") button there could be another action defined like ** go to next word form **, so clicking on "am" adds "am" to the bar and at the same time changes "am" to "was". The user then could click "was" in order replace "am" with "was" in the bar, or leave it as it is, if "am" is the desired form.

A simple special form of the approach would be to define word forms of an element without any tags so, e.g.:

  • base form (label): "sibling"
  • other forms: "max", "anna", "peter"

As before an action like ** go to next word form ** on this element would make it possible to choose one of the siblings.

The page designer would add a "word list" action to a grid element.

Yes, I think both should be in the same tab for "word forms" in the "edit element" dialog. There you could define word forms with tags to be able to do more sophisticated things like discussed before or only a list of words without tags for the simple use case, like for the siblings.

@klues
Copy link
Contributor

klues commented Jan 2, 2024

A question that arises for me: "How to manage the tags for word forms"? Some possibilities:

  1. Tags are completely free to define, nothing default
  2. There are default tags for the most important concepts like 1.P, 2.P, ... NEGATION, PLURAL, ... - maybe with the possibility to extend these default tags with own ones.
  3. Next to single tags, there also could be default (or defineable) groups of tags, like (1.P, PLURAL), (1.P, PLURAL, NEGATION), (1.P, PLURAL, NEGATION, PAST), ...
  4. Maybe it even makes sense to make it possible to define which groups of tags make sense for which word form, like:
    • VERB -> (1.P, PLURAL), (1.P, PLURAL, NEGATION), (1.P, PLURAL, NEGATION, PAST), ...
    • NOUN -> (SINGULAR), (PLURAL), (SINGUAR, ACCUSATIVE), ...
    • ADJECTIVE -> (MASCULINE), (FEMININE)
    • so while defining word forms in the edit dialog, one could select VERB and get all predefined groups of tags, which then only have to be filled with the correct values ("are", "aren't", "weren't", ...). For verbs these forms could automatically be retrieved from the verbix API.

@jamjolu
Copy link
Author

jamjolu commented Jan 2, 2024 via email

@klues klues changed the title Reopening #252 - Proposing a simple means to cover various word forms from a button action Proposing a simple means to cover various word forms from a button action Jan 3, 2024
@klues
Copy link
Contributor

klues commented Jan 3, 2024

I wonder if adding a "next word form" element could be added to the Global
Grid to cycle through options, if there are any? And, would that be
preferable?

I think it should be possible. However then it probably would only cycle through the forms for the last element added to the bar and not all elements with word forms in the grid?!

By the way, I just put together an audio book search and play page based on
a collaboration between Project Gutenberg (public domain literature in
English)

Great idea. I've planned an integration of podcasts to AG, which would be quite similar in terms of listening to long audio files. However I've not thought about it in detail and further discussions about it should be done in a separate issue.

@klues
Copy link
Contributor

klues commented Jan 3, 2024

I have more questions about the word form implementation. I've to decide how to save the data internally and this has implications on the usability. So we have to decide if:

  1. word forms (tags) are independent for every language, so for the same element in one language there could be a word form with tags (1.P + NEGATION) and for another language (PLURAL, FEMININE). This example doesn't make sense of course, but maybe in some cases it makes sense?!
  2. tags for word forms are equal for all languages, so if there is a word form (1.P + NEGATION) for instance for "German", this combination of tags is also available in all other languages where word forms for this element are defined. However if a word form doesn't make sense for a specific language, the value could simply be empty.

What do you think?
I think (2) makes more sense. Then it would be only needed to define all possible tag combinations like (1.P + NEGATION), (2.P + NEGATION), (3.P + NEGATION), ... once and then fill the values for all languages. If there is a special case for a language, then you could simply add a new tag combination and fill the value only for this language.
A set of possible tag combinations additionally could be linked to specific word types, which would reduce the work of setting up word forms, see my previous question.

So technically speaking the data format would be something like this:

let wordforms = [
    {
        tags: ["BASE"],
        value: {
            "DE": "sein",
            "EN": "be"
        }
    },
    {
        tags: ["1P"],
        value:  {
            "DE": "bin",
            "EN": "am"
        }
    },
    {
        tags: ["2P"],
        value:  {
            "DE": "bist",
            "EN": "are"
        }
    },
    {
        tags: ["1P", "NEGATION"],
        value:  {
            "DE": "bin nicht",
            "EN": "am not"
        }
    },
    {
        tags: ["2P", "NEGATION"],
        value:  {
            "DE": "bist nicht",
            "EN": "aren't"
        }
    }
    // ...
]

And this would be an example, were some tags are only for available for specific languages:

let wordforms = [
    {
        tags: ["BASE"],
        value: {
            "EN": "red",
            "ES": "rojo"
        }
    },
    {
        tags: ["FEMININE"],
        value: {
            "ES": "roja"
        }
    },
    {
        tags: ["MASCULINE"],
        value: {
            "ES": "rojo"
        }
    }
]

So if the current content language is "EN" and the action ** change to MASCULINE ** is performed, the word form would simply stay at the base form "red".

For the "sibling usecase" I think it will be something like this:

let wordforms = [
    {
        value: {
            "DEFAULT": "Benjamin",
        }
    },
    {
        value: {
            "DEFAULT": "Jim"
        }
    },
    {
        value: {
            "DEFAULT": "Matthew",
            "DE": "Matthias",
            "EN": "Matthew",
            "ES": "Mateo",
            "IT": "Matteo"
        }
    }
]

So Benjamin and Jim would be displayed for all languages and the third one would be different accross languages (but default to Matthew for all non-defined languages). Here we wouldn't necessarily have any tags, since it's just a list of words.

@ms-mialingvo
Copy link
Collaborator

ms-mialingvo commented Jan 3, 2024

I think that will be possible if the ** not ** button also is a button which changes the word form, like ** 2nd person plural ** before. So it will change all word forms (where existing) to the form labelled with NEGATION. And therefore it could also change words in the collection bar to this NEGATION form, which has to be added within the original button for "is/are/aren't". However in this case we'll need a system where it's possible to add multiple labels to word forms like this:

1.P -> am
2.P -> are
3.P -> is
1.P, NEGATION -> "am not"
2.P, NEGATION -> "aren't"
3.P, NEGATION -> "isn't"
So then the first button ** 2nd person plural ** selects the first word form with label 2.P ("are") and the ** not ** button will then additionally select NEGATION, so that in total it will select 2.P + NEGATION = "aren't".

I just realised that I'm not sure if I understood this correctly.
1.P changes the button "be" to "am"
Click on "am" adds it to the collection bar
Click on NEGATION changes the "am" in the collection bar to "am not"
Like that?
Because if that's the way you meant it, that's the same I meant to achieve with the if-then suggestion.
And that would just change the last word? So one could write "I am small, you aren't small"?

A question that arises for me: "How to manage the tags for word forms"? Some possibilities:

I'd go with 2 (default tags for the most important concepts like 1.P, 2.P, ... NEGATION, PLURAL, ... with the possibility to extend these default tags with own ones) but while trying it to keep it as language-neutral as possible. Which could be done by using abbreviations, so not SINGULAR but SG, PLURAL but PL, ACCUSATIVE but ACC etc.
Also yes to groups of tags, though not sure default combinations would be needed.
4 just as long as this is an optional thing and all tags are available when no word form is chosen, because what is an adjective in one language is a noun in another etc. Or like word can be used both as noun and as verb.

I have more questions about the word form implementation. I've to decide how to save the data internally and this has implications on the usability. So we have to decide if:

The most common case will be that a word in one language can use tags that another language doesn't need. E.g. an example with an adjective like "small". For English the tags (comparative, superlative) is all that could be applied to the word. For Spanish the tags (masculine/feminine, singular/plural, comparative, superlative, diminutive) could be applied.

@klues
Copy link
Contributor

klues commented Jan 4, 2024

1.P changes the button "be" to "am"
Click on "am" adds it to the collection bar
Click on NEGATION changes the "am" in the collection bar to "am not"
Like that?
Because if that's the way you meant it, that's the same I meant to achieve with the if-then suggestion.

Yes, exactly, this was my idea. And yes, in this case you can achieve the same thing like with the if-then rules, but with no extra system which has to be there to define these if-then rules - that's why I like it better.

And that would just change the last word? So one could write "I am small, you aren't small"?

Yes. We also could think of some special rules like "if a button changes the last word in the bar, don't add it to the bar, otherwise add it" and "if a word form is added to the bar, where the last word in the bar caused this word form, remove the last word before adding the new one". A practical example:

  • there is a button "not" which also has the action ** change words to NEGATION **
  • user clicks on "are" - added to the bar
  • user clicks on "not" - changes "are" to "aren't" in the bar, but doesn't add "not" to the bar, since the last word ("are") was changed.

Other way:

  • user clicks "not" - "not" is added to the bar, at the same time the button for "are" is changed to "aren't"
  • user clicks button "aren't"
  • "not" is removed from the bar, since it has an action ** change to NEGATION ** and NEGATION is a tag of the currently added word form "aren't" - so only "aren't" remains in the bar

The most common case will be that a word in one language can use tags that another language doesn't need. E.g. an example with an adjective like "small". For English the tags (comparative, superlative) is all that could be applied to the word. For Spanish the tags (masculine/feminine, singular/plural, comparative, superlative, diminutive) could be applied.

OK, so you would think that tags should be completely independent for every language? Maybe with the possibility to add some predefined / user defined sets of tags to a word form for a specific language (I think of verbs, where it will be cumbersome to add all persons / plural for every language again)? Then the question of how to implement / define the ** change to form XY ** actions becomes harder. Then probably we would need to be able to define XY separately for every language.

So the word forms would look more like this (just writing it down for me, in order to be able to imagine):

let wordforms = {
    "EN": [
        {
            tags: ["BASE"],
            value: "tall"
        },
        {
            tags: ["COMPARATIVE"],
            value: "taller"
        },
        {
            tags: ["SUPERLATIVE"],
            value: "tallest"
        }
    ],
    "ES": [
        {
            tags: ["BASE"],
            value: "alto"
        },
        {
            tags: ["FEMININE"],
            value: "alta"
        },
        {
            tags: ["MASCULINE"],
            value: "alto"
        },
        {
            tags: ["MASCULINE", "PLURAL"],
            value: "altos"
        },
        {
            tags: ["MASCULINE", "SUPERLATIVE"],
            value: "el mas alto"
        }
    ]
}

And here I think it needs some feature to quickly add sets of tags to a word, in order to prevent duplicated work. So if adding many spanish adjectives, to quickly add serveral word forms with tags: ["BASE"], ["FEMININE"], ["MASCULINE"], ["FEMININE", "PLURAL"], ...

For actions we would need something like this:

let changeWordAction = {
    "EN": {
        changeToTags: ["SUPERLATIVE"]
        // maybe more properties
    },
    "ES": {
        changeToTags: ["MASCULINE", "SUPERLATIVE"]
        // maybe more properties
    }
}

@ms-mialingvo
Copy link
Collaborator

ms-mialingvo commented Jan 4, 2024

Yes, exactly, this was my idea.

Yay, perfect =)

"if a button changes the last word in the bar, don't add it to the bar, otherwise add it"

So that would in the case of "am/is/are not" result in one not having to programm "am not" in the "to be" button, because that would happen automatically? Sure could be useful in some cases / for some languages.

"if a word form is added to the bar, where the last word in the bar caused this word form, remove the last word before adding the new one".

Can't right now think of a case where that would be useful respectively how it isn't already kinda covered with the other options but I haven't finished going through all of the grammar of the languages that I want to translate to.

OK, so you would think that tags should be completely independent for every language? Maybe with the possibility to add some predefined / user defined sets of tags to a word form for a specific language (I think of verbs, where it will be cumbersome to add all persons / plural for every language again)?

I think having a set of predefined tags for all languages of the most common flexions/changes not connected to a word form can be useful. Jim and others would have to say if they deem an additional connection to word forms useful for them, for me I don't need it.

I think the most common tags would be for verbs
1.p.sg.
2.p.sg.
3.p.sg.
1.p.pl.
2.p.pl.
3.p.pl.

then for adjectives comparative, superlative
and for nouns maybe all the "common" cases? nominative, accusative, dative, genitive, ablative, locative, instrumental. And indefinite/definite.
And for all three word forms masculine/feminine and singular/plural

Then the question of how to implement / define the ** change to form XY ** actions becomes harder. Then probably we would need to be able to define XY separately for every language.
So the word forms would look more like this (just writing it down for me, in order to be able to imagine):

Not sure if I'm understanding this correctly. Is XY the name of the tag? Because if yes, then in the example it should FEMININO, MASCULINO, SUPERLATIVO.
Though for my set, the XY would be the same accross languages, so like... neg. for negation, independently whether you are on the English, German or French version of the set, and I'd document it for people so they understand the tags even if "neg." doesn't mean anything at all in their language. Having XY different accross languages (e.g. accusative in English, Akkusativ in German) might be more user-friendly but could lead to a mess of tag names. I can provide a list of all the tags I will use once I finished going through the grammar of the languages.

But yeah, I'm not sure if I've understood that correctly.

@klues
Copy link
Contributor

klues commented Jan 4, 2024

So that would in the case of "am/is/are not" result in one not having to programm "am not" in the "to be" button, because that would happen automatically?

Can't right now think of a case where that would be useful

Please look at my two practical examples in my comment right below these rules to see where I think these rules could make sense.

Not sure if I'm understanding this correctly. Is XY the name of the tag?

No, it's the tag to which the word forms should be changed to. I also think that I wouldn't translate tag names, so NEGATION or 1.PERS or whatever is the same for everyone in every language. My question was related to this, imagine:

  1. there is the word form "alta" with tag FEMININE for Spanish
  2. there no word form with tag FEMININE for this same word for English
  3. User presses "she / ella" -> changes word forms to "FEMININE" -> in this case this only makes sense for Spanish, so my question is, if for the action ** change to FEMININE ** we'll have to define that this is only performed, if the current language is Spanish. But maybe it's not needed. I think probably I'll just start to implement something, which then can be tested - maybe it was enough theoretical thinking for now ;)

@klues
Copy link
Contributor

klues commented Jan 5, 2024

My first draft for the UI defining word forms:

grafik

On the top possibilities to add new word forms and import / export them from / to some spreadsheet software. In the table the possibilities to edit, remove and rearrange them:

grafik

Rendering of the tags within the table should be the same like in the selection element, but as said, it's the first draft. Feel free to give feedback.

@ms-mialingvo
Copy link
Collaborator

I just shouldn't multitask while writing a post here ;) Re-writing my previous post.

My first draft for the UI defining word forms:

It's looking good for me, very intuitive and user-friendly. :)

@ms-mialingvo
Copy link
Collaborator

Also, something that just crossed my mind: Since you wrote that it could be possible to import conjugations (and automatically add the labels) using the API from verbix.com... If tables with all the necessary flexions for non-verbs exist for all needed languages and they are somewhere online, would it be possible to import them in one go via API too? After applying whatever-necessary programming to it, of course, I'm struggling to understand how APIs work...

Also, will the imported conjugations be visible in the word forms overview or will only the word forms that people specifically create be visible there?

@klues
Copy link
Contributor

klues commented Jan 8, 2024

If tables with all the necessary flexions for non-verbs exist for all needed languages and they are somewhere online, would it be possible to import them in one go via API too?

There are services which really provice an API, which is meant to be used programmatically by other applications (like Verbix). So you can do a request to a specified enpoint like https://api.verbix.com/finder/json/<apikey>/<version>/<language>/<verb> and get a machine-readable result (e.g. in JSON format).

There are many other services, which also provide the data, but no API, e.g. Reverso. Now of course it is also possible to programmatically retrieve data from a website like this, however it's more effort and probably also often violates the copyright/terms of use of the sevice.

I saw that you have to apply to get access to the Verbix API, which I've done now.

There are also other projects like these which provide ways to use data from an open source, which has no API (like Wiktionary):

If tables with all the necessary flexions for non-verbs exist for all needed languages and they are somewhere online, would it be possible to import them in one go via API too? After applying whatever-necessary programming to it, of course, I'm struggling to understand how APIs work...

Yes, if we find good APIs, which is the hard part. I've also found paid ones like ultralingua.com, but the quality of the result wasn't very convincing for my tests.

Also, will the imported conjugations be visible in the word forms overview or will only the word forms that people specifically create be visible there?

All should be visible in the table, shouldn't matter if it's added manually or via spreadsheet import or an API.

@ms-mialingvo
Copy link
Collaborator

If tables with all the necessary flexions for non-verbs exist for all needed languages and they are somewhere online, would it be possible to import them in one go via API too? After applying whatever-necessary programming to it, of course, I'm struggling to understand how APIs work...

To clarify where I want to go to with this question: For the word forms that are not available through verbix - or if verbix wouldn't work then for all necessary forms - I will be producing them myself. Originally in excel but that can then be transformed to whatever other format needed. So, once this data is created, I'd be totally fine with making it publicly available for everyone under CC, like it could be uploaded to the domain of my project or even directly to asterics.eu or to github. What I want to know as I don't understand the programming part of it, is if it would be possible to transform/program the data in a way that would make it available for automatic use in AsTeRICS Grid for everyone, like you're planning with verbix? Maybe even in a way where anyone who wants to add more words or more languages would be free to contribute and it would then again be automatically available for AsTeRICS Grid? (If I'm understanding the screenshot correctly, with the import option you've created one would have to import the data for each word separatedly, not all at once?)

All should be visible in the table, shouldn't matter if it's added manually or via spreadsheet import or an API.

Great! :)
If possible it would then be great to have some way to either filter it or to have subsections for different languages or something else like that. From the screenshot at the moment it looks like all word forms for all languages would be listed one after the other, not just the language you're currently in, and when you have a boardset that is translated to 5 languages, even if you just have 12 verb forms (present, past) for each it would be already 60 words and it would quickly get hard to keep an overview.

@klues
Copy link
Contributor

klues commented Jan 9, 2024

So, once this data is created, I'd be totally fine with making it publicly available for everyone under CC, like it could be uploaded to the domain of my project or even directly to asterics.eu or to github.

That's great and very much fits with our idea of open ressources for AAC 👍

What I want to know as I don't understand the programming part of it, is if it would be possible to transform/program the data in a way that would make it available for automatic use in AsTeRICS Grid for everyone, like you're planning with verbix?

Yes, it would be definitely possible, however of course some more work to do. At the moment I would just try to create the data in machine-readable way, then it can be transformed to whatever needed for an API easily. I can imagine creating such an API on my own in the future or maybe also @arasaac-dga could imagine to do it?!

The easiest way would be just to upload it on github (probably best within an own repository) and if the structure is good, then github also could be used as an API, like ian-hamlin/verb-data already did it. At this repo it's already possible to use the github API like https://raw.githubusercontent.com/ian-hamlin/verb-data/master/json/spanish/content/e/echar.json and directly use this within AsTeRICS Grid. This repo could also be forked (copied) and then more language/words could be added.

But as said, the first step is to create the data in a machine readable way. I would propose this format within a spreadsheet:

LANG BASE TAGS VALUE
DE sein 1.PERS bin
DE sein 2.PERS bist
DE sein 3.PERS ist
DE sein 1.PERS, PLURAL sind
DE sein 2.PERS, PLURAL seid
DE sein 3.PERS, PLURAL sind

Then it's easy to filter the words within the spreadsheet and also to import/export them to/from AsTeRICS Grid or any format that's needed for an API. It would be also possible to try to write a program that automatically extracts word forms data from these Wiktionary tables: https://de.wiktionary.org/wiki/Flexion:sein - it would be OK, since these ressources are already CC licensed.

@ms-mialingvo
Copy link
Collaborator

But as said, the first step is to create the data in a machine readable way. I would propose this format within a spreadsheet:

Perfect :)

@klues
Copy link
Contributor

klues commented Jan 11, 2024

I have moved forward in implementing and I have a question. Look at this example:

chrome_9jXm11lVwL

What happens in the background:

  1. click "You" -> action ** add tag 2.PERS ** -> "be" changes to "are"
  2. click "are" -> added to bar, at the same time clears collection of tags in the background, since it's an element not doing any word form changes
  3. click ** NEGATION ** -> tags 2.PERS and NEGATION are accumulated for "are" in the bar -> changes to "aren't" in the bar. This accumulation of the tags is only done for this one word in the bar, the general collection of tags was cleared in the last step, so there is only the NEGATION tag and the "be" element shows the first form with NEGATION, which is "am not"
  4. click "He" -> action ** add tag 3.PERS ** -> collection of tags in the background is NEGATION and 3.PERS -> "be" shows "isn't"

My question: how now one could write "you aren't he is" instead of "you aren't he isn't" using our system? I think we need some extra button/action "reset word forms" for cases like this. Or do you have a different idea?

With this clicking order everything would be fine:

  1. click "You" -> added to bar
  2. click NEGATION -> "be" shows "aren't"
  3. click "aren't" -> collection of tags clears in background
  4. click "He"
  5. click "is" -> bar shows "you aren't he is"

So the problem is only for the case where the word in the bar is changed afterwards.

@ms-mialingvo
Copy link
Collaborator

Would it be possible to clear the tags whenever a grammar button is clicked that changes a word in the speaking bar? (Provided that "2.Pers" and "negation" are different kinds of grammar buttons in that if one were to click first "you" then "be" and afterwards "2.pers." it would not change the "be" in the bar to "are"?) Or better, would it be possible to tell it to apply the negation only to the bar and not the rest of the board?

@klues
Copy link
Contributor

klues commented Jan 12, 2024

Theoretically anything which is a consistent rule is possible to program. However I wonder what's most intuitive and understandable.

I wonder what's the benefit if it's possible to change word forms within the bar and within the grid at the same time or if it would be better to globally choose between one of both approaches:

  1. Only change word forms within the bar, so for writing "You aren't, he is":
    • You -> be -> 2.PERS -> NEGATION (changes "be" to "aren't" in bar) -> He -> be -> 3.PERS (changes "be" to "is" in bar)
  2. Only change word forms within the grid elements, so for writing "You aren't, he is":
    • You -> 2.PERS -> NEGATION -> be (which is changed to "aren't" in the element) -> He -> 3.PERS -> be (which is changed to "is" in the element)

I think approach (2) in general is more intuitive and also has the benefit that "You" could already have the action ** change to 2.PERS **, so in total it would need less clicks. From a learning perspective maybe it doesn't make sense to mix both approaches, for the learner it probably won't be consistent if he/she sometimes has to press the grammar button before and sometimes after the word that has to be changed.

@klues
Copy link
Contributor

klues commented Feb 7, 2024

Finally I think/hope we've reached a state which can be released to the main version.
So please @jamjolu @msantos-87 @arasaac-dga read this final changes/new features and test them:

  • for word forms now it's possible to define an optional Pronunciation, so if TTS fails, you can provide an alternative, which is only used for TTS, not for showing in the bar:
    grafik
  • Import/Export of word forms now offers the possibility to import/export all word forms across all grids, so only a single action for updating the whole configuration is needed:
    grafik
    Note that for import from speadsheet you must have these columns: WORD FORM, LANG (2 digits), TAGS (comma separated), LABEL, PRONUNCIATION. Order of colums is important, but not all have to be existing, so it's also possible to copy only the first ones. LABEL has to be the label of the element in the grid in the current language, so, e.g. be for all rows (only important for importing globally).
  • possibility to toggle elements in collection bar, if selected multiple times, see previous comment.
  • other minor improvements:
    • button for deleting all word forms
    • showing language names in language dropdowns (see Language dropdown #364 )
    • dropdown for filtering word forms by language
    • the option to convert the case (lower-, uppercase) should now correctly work for all word forms and within the bar

Additionally I did quite big changes to the code for the collection element (bar). Previously I've collected "text only" and "elements with images" separately, which results in quite complex and error-prone code. So I've changed it and now I'm collecting elements only in a single, unified way. However of course, this should be tested well, in order to make sure that I haven't broken something that was working before.

I've updated my test configuration, which you could also use:
test-grammar_2024-02-07_09-55_asterics-grid-full-backup.zip

It contains:

  • new tests for "speak custom" and "play audio actions", which still "win" against word forms, so if both are defined (which doesn't make much sense), the older features will win.
  • a test for the case with Tom and Ana are tired (see previous comment)
  • two collection bars, one using images, one text-only in order to see if both are working correctly
  • a keyboard with word prediction, in order to test if everything there is still working correctly

If everything works fine and no errors are found, I would like to release this state and for fine-tuning or minor feature improvements, we should use new issues.

@arasaac-dga please also update the translations in crowdin.

@ms-mialingvo
Copy link
Collaborator

ms-mialingvo commented Feb 7, 2024

and 'I am' by clicking twice on 'to be'

So you're using I am as a word form of to be? I'm not sure it if this is the most flexible in the long term, and if forms of to be should really include the persons?!

There are a bunch languages that don't use separate pronouns so the equivalent of the English I am is one word (or one suffix). I originally was also using actually "I am" as a word form in languages like English or German, but yes, have noticed, that it's suboptimal.

Sending you an email in a moment.

klues added a commit that referenced this issue Feb 7, 2024
klues added a commit that referenced this issue Feb 7, 2024
klues added a commit that referenced this issue Mar 11, 2024
klues added a commit that referenced this issue Mar 11, 2024
…oncatenated base forms like "sein:de;ser:es", #254
klues added a commit that referenced this issue Mar 11, 2024
klues added a commit that referenced this issue Mar 11, 2024
klues added a commit that referenced this issue Mar 11, 2024
klues added a commit that referenced this issue Mar 11, 2024
klues added a commit that referenced this issue Mar 12, 2024
@klues
Copy link
Contributor

klues commented Mar 12, 2024

This is the finished textual documentation for the word form feature: https://github.com/asterics/AsTeRICS-Grid/blob/master/docs/documentation_user/10_word_forms.md

@arasaac-dga
Copy link
Collaborator

Checking if really our Grammar API wins over the Word Forms we have found one case in which that doesn't happen. As you can see in video attached (https://app.box.com/s/r2s2myp7p5luzbf5vmcdsrfe8c4ml4m0), when "Change word form in grid elements" is selected the verb is changed to "quiere" when you press in "él" and when you press PLAY the API grammar must change to "yo y él queremos comer" as made when you select other action like "Change in collection element" (see video https://app.box.com/s/r2s2myp7p5luzbf5vmcdsrfe8c4ml4m0). We have tried other communicators and the problem occurs too. So, please check it in order the API always win ;-)

@klues
Copy link
Contributor

klues commented Mar 12, 2024

Your API still "wins" in this situation, however the result for yo y el quiere comer is the same using the API, see https://api.arasaac.org/api/phrases/flex/es/Yo%20y%20%C3%A9l%20quiere%20comer (you see that the API's result is used because the original is Yo and then it changes to yo)

In the second example yo y el quiero comer is sent to the API, which results in the correct sentence, see:
https://api.arasaac.org/api/phrases/flex/es/Yo%20y%20%C3%A9l%20quiero%20comer

@arasaac-dga
Copy link
Collaborator

Yes, it's true. Thanks to this example we have located a little issue only with "want" verbs and only in some persons. With other verbs, fix the grammar correctly. So it's on our part. Thanks anyway for checking it.

klues added a commit that referenced this issue Mar 18, 2024
…ed for word forms -> change everywhere (otherwise "I am" -> "You" changes "am" to "are"), #254
klues added a commit that referenced this issue Mar 18, 2024
…action with tags of currently selected word form, #254
klues added a commit that referenced this issue Mar 18, 2024
…howing "am" and "am not" for 1.PERS (not "you" etc.), #254
klues added a commit that referenced this issue Mar 18, 2024
klues added a commit that referenced this issue Mar 19, 2024
@klues
Copy link
Contributor

klues commented Mar 20, 2024

@klues klues closed this as completed Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants