Newbie: How to use store and index to find double-typed vowels and transcribe them for hebrew

Hi,

I am trying to make toggles for transcribing the hebrew vowels.
Like when clicking on the “a” you get: a > â > ā.
And the same for the others. I also want the add the shifted vowels.
I got it working as manual rules like:

"a"		+"a" 	> U+0101		
U+0101 + "a" 	> U+00E2 		
U+00E2 + "a" 	> "a" 			

"A"		 		> U+0101		
U+0101 	+ "A" 	> U+00E2 		
U+00E2 	+ "A" 	> U+0101

But that is a lot of lines.

I would like to make some stores and then a few rules like:

store(vow) "aeuio"
c macron: a, e  / cirumflex: u i o
store(vowToggle1) U+0101 U+0113	U+00FB U+00EE U+00F4
c cirumflex: a e / macron: u i o
store(vowToggle2) U+00E2 U+00EA U+016B U+012B U+014D

any(vow) 		+ index(vow,1) > index(vowToggle1,1)
any(vowToggle1) + index(vow,1) > index(vowToggle2,1)
c ..... etc....

But that is not working since index is not allow as key. Is there any way to do something like this, or is the manual way our only option here?

Adding to this question: is it possible to use shift/ctrl/alt etc with store and any? I tried and searched for it, but could not find it or get any of these working:

[SHIFT] 		+ any(vow) > index(vowToggle1,2)
[K_SHIFT] 		+ any(vow) > index(vowToggle1,2)

Thanks in advance!
flexJoly

This is possible with multiple groups. It takes a little crafting but it looks something like this:

store(vow) "aeuio"
c macron: a, e  / cirumflex: u i o
store(vowToggle1) U+0101 U+0113	U+00FB U+00EE U+00F4
c cirumflex: a e / macron: u i o
store(vowToggle2) U+00E2 U+00EA U+016B U+012B U+014D

+ any(vow) > index(vow, 1) deadkey(rota)
match > use(rota)

group(rota)

any(vow) deadkey(rota) index(vow,1) deadkey(rota) > index(vowToggle1, 1) deadkey(rota)
any(vowToggle1) deadkey(rota) index(vow, 1) deadkey(rota) > index(vowToggle2, 1) deadkey(rota)
c ... etc ...

I used the deadkey(rota) (or dk(rota)) marker here so that editing existing text doesn’t trigger the rota behaviour - you would need to delete the original vowel and retype it, because deadkeys are ephemeral.

You’ll note that the rota group is not a using keys group - this means it operates only on the context passed in from the previous output (plus what is in the document).

1 Like

Thanks @Marc !!

That works great!! I did not use the deadkey part. At the moment I do not see the need for that.
If that is because I am new to this, I would greatly appreciate extra explaination or a link where I can see the difference.
Or maybe a working (demo) keyboard with this feature. I tried the menu-keyboard in the tutorial, but it does not work when installed.

Did you also see my second question about the shift-key?
If read something about the cased-store. But I dont think that will help. Because for hebrew you need to group different characters together in stores. Just adding the shift-button to a lowercase store would automate a lot of stores :wink:

Thanks so far!!!

The deadkey is really helpful to prevent situations where a user may not want the rota to apply, for example when editing existing text. It’s up to you whether you use it or not – it can be a helpful pattern which is why I included it.

Re your shift key question, no, the way you are structuring it doesn’t work. You have to specify the shift modifier as part of the virtual key.

store(shifted-vow) [SHIFT K_A] [SHIFT K_E] [SHIFT K_U] [SHIFT K_I] [SHIFT K_O]

+ any(shifted-vow) > index(vowToggle1, 1)

Of course, the shifted-vow store can only be used in the key part of the rule (not in context or output).

1 Like

Thanks for your reply.

As newbie to this all, I do not see the problem of editing text yet :wink:
I will try to remember.

The shift… that is truly a bummer :frowning: that something frequent like this need to be handled manually. But I can understand why this is not made or has priority.

Thanks for your explanations and help!!!