Contextual substitution

Hi,

I’m a bit puzzled with substitutions. I have an uppercase typeface, where K R can act as initial forms (calt01) having their legs under the next character (calt02)

sub [K R]’ [A H I K N R] by [K.calt01 R.calt01];
sub [K.calt01 R.calt01] [A H I K N R]’ by [A.calt02 H.calt02 I.calt02 K.calt02 N.calt02 R.calt02];

Everything well with current sentence until I want to add ‘medi’ forms between them (calt03)

sub [K R]’ [A H I K N R] by [K.calt01 R.calt01];
sub [K.calt01 R.calt01] [K R]’ [A H I K N R] by [K.calt03 R.calt03];
sub [K.calt01 R.calt01] [A H I K N R]’ by [A.calt02 H.calt02 I.calt02 K.calt02 N.calt02 R.calt02];

But this is not working. Should I use lookups for that?

Yes, a lookup can build on the result of the previous lookup.

Thanks, Rainer!

This is producing almost required result:

lookup LigaFina_01 {
sub [K R] [A H I K M N R]’ by [A.calt02 H.calt02 I.calt02 K.calt02 M.calt02 N.calt02 R.calt02];
} LigaFina_01;

lookup LigaInit {
sub [K R]’ [A.calt02 H.calt02 I.calt02 K.calt02 M.calt02 N.calt02 R.calt02] by [K.calt01 R.calt01];
sub [K R]’ [K.calt03 R.calt03] by [K.calt01 R.calt01];
} LigaInit;

lookup LigaMedi {
sub [K.calt02 R.calt02]’ [A H I K K.calt02 M N R R.calt02] by [K.calt03 R.calt03];
} LigaMedi;

lookup LigaFina_02 {
sub [K.calt03 R.calt03] [A H I K N R]’ by [A.calt02 H.calt02 I.calt02 K.calt02 N.calt02 R.calt02];
} LigaFina_02;

1 Like

Almost, because it’s still producing n×2 + 3 scheme. Will dig deeper.