Order of typing Hebrew characters

The presentation characters for Hebrew should typically only be supported for legacy situations dealing with (very) old data. We would not normally advise including them in a keyboard created today.

can you suggest an existing keyboard that does recursive reordering, whose code I can view?

I haven’t been able to locate any good examples, sorry.

any(b) any(a) > context(2) context(1)
any( c) any(b) > context(2) context(1)
any( c) any(a) > context(2) context(1)

if I enter ab, all is good.
if I enter ba, reorder to ab.
if I enter ca, reorder to ac.
if I enter cb, reorder to bc.
if after I enter cb and it reorders to bc, I then enter a, will it reorder the ca to ac, resulting in bac?
if not, how do I make it go back to the start and reorder ba to ab, resulting in abc?

Yes, you’ve got the right approach. Just to illustrate. Imagine we are swapping the a from the end to the beginning. This takes 3 steps from beginning to end:

b c d a
b c a d
b a c d
a b c d

The trick here is just to extend what you’ve already done, and make the group recursive with a match rule:

c convenience stores
store(bcd) outs(b) outs(c) outs(d)
store(bc) outs(b) outs(c)
store(cd) outs(c) outs(d)

c pairwise swaps
any(d) any(c) > context(2) context(1)
any(cd) any(b) > context(2) context(1)
any(bcd) any(a) > context(2) context(1)

c swaps 2/3
any(bc) any(a) any(d) > context(2) context(1) context(3)

c swap 3/4
any(b) any(a) any(c) any(d) > context(2) context(1) context(3) context(4)

match > use(reorder)

So the longest possible series has only one rule, with an additional rule needed for each subsequent level. I realised it’ll be more than one rule per character class but still hopefully not insurmountable!

  1. ? this can’t be reduced to:
    any(b) any(a) any(cd) > context(2) context(1) context(3)
  2. ? I don’t need also:
    any(b) any(cd) any(a) > context(3) context(1) context(2)

I was giving an example with 4 different characters to be sorted. The convenience store cd is a set of both c and d – but any(cd) still only matches a single character in the context.

You won’t need the any(b) any(cd) any(a) rule because that is covered with the rule any(bcd) any(a) > context(2) context(1) rule; then the recursion we implement with match ensures that the resulting b a c/d text gets resorted to a b c/d with any(bc) any(a) any(d) > context(2) context(1) context(3).

But I did miss a rule in the swaps 2/3 section:

any(c) any(b) any(d) > context(2) context(1) context(3)

I would love to add a function to the compiler to generate these rules automatically, for example with something like the following hypothetical construct:

group(reorder) defines order

reorder > any(a) any(b) any(c) any(d)

That would expand out to the rules shown above, including the match rule. I suspect this is insufficient for a comprehensive solution. Would anyone want to take a stab at defining this more completely and specifying how it transforms into a set of rules in order to add it to the compiler? As a compiler-only change, it would be easy to test and would not have runtime impacts.

I think what may be confusing me is that any of the characters except any(a) can be repeated randomly in the sequence (although admittedly there are constraints that make some permutations less likely in reality). Therefore, besides a b c d, we need to account for
a c b c
a c c b
a d b b
a c b b
a d d b
a d d c

b a b b
b a b c
b a b d
b b d c
b c b d

b b b a
c c c a
d d d a
does that change the number of rules necessary?

Sadly, yes, that makes the problem significantly more difficult. A completely generalized solution would not be possible because the length of the string could not be determined. In practice, though, how common are the repeated characters – what are the constraints there?


How it works depends on the keyboard developer.







would that work?





:heavy_check_mark: I like that! thanks

1 Like


1 Like

A keyboard developer when developing with combining characters has two options:



