# Four experiments [was Re: [Aleph] feature request :-))]

ishamid ishamid at lamar.colostate.edu
Mon Jul 26 16:48:57 CEST 2004

Hi Giuseppe and our fellow conspirators,

>===== Original Message From Discussions concerning Aleph <aleph at ntg.nl> =====

>The problem, and the *proper* way to do it, is to set up
>different priorities for the various OCPs! The magic number
>after the \add<...>ocplist *should* be different. If you give
>priority 1 to the first, priority 2 to the second and priority
>3 to the last it *will* work, *regardless of the order in which
>you push the ocplists!

Ok, we r going to need Hans' help here:

\definefiltersequence[][]

now needs keys to determine the relative priority of the \add<...>ocplist
lines, e.g., something like

\definefiltersequence
[Sequence]
[SegmentOne,SegmentTwo,Segment3]
[1,2,3]

for

\ocplist\Sequence=
\nullocplist

Now what about more complicated cases, where there are meta-sequences?

\def\MetaSequence{%
\clearocplists
\usefiltersequence[SequenceOne]
\usefiltersequence[SequenceTwo]
}

Does SequenceTwo need to use, say, priority 4, 5, and 6, or can it use 1, 2,
and 3 like SequenceOne? This can get really messy for long concatenations of
Sequences!

I agree with an earlier comment you made that an abstraction list based on
complete \ocplist segments is more elegant than one based on
segments. On the other hand, in the complete \ocplist segments approach we
need a manageable way to handle all the relative priorities of the \ocplist's
so that we can construct working meta-sequences.

So here is the ideal abstraction process (using ConTeXt/Gamma):

%%% low-level filter definitions

\definefiltersynonym[Name1][OCPname1]
\definefiltersynonym[Name2][OCPname2]
:

%%% ocplist segments, each for a specific task

\definefiltersequence
[SequenceOne]
[Name1,Name2]
[1,2]

\definefiltersequence
[SequenceTwo]
[Name3,Name4]
[3,4] % or [1,2]???

:

%%% next abstraction layer

:

%% For example, in the middle of a
%% document the user may want to redefine

%% Hans, can we have a more user friendly macro for
%% this abstraction layer?

%%% Meta-sequences %% gives everthing needed per language
%% Hans, can we have better macros than this?

\def\MetaSequenceTwo{%
\clearocplists
\usefiltersequence[SequenceTwo]
:
}

Note that each \MetaSequence<> contains a \usefiltersequence[] line. This is
the catalyst ocplist that determines the primary function of the
\MetaSequence<>. So \MetaSequenceTwo carries all the information needed for a
given language from whatever is predefined in the document; the only thing it

So if \usefiltersequence[SequenceTwo] stands for, say, full vocalization, then
\MetaSequenceTwo will always carry out full vocalization, no matter how the
other \MyTask<>'s are defined elsewhere in other \MetaSequence<>'s.

A similar procedure can be constructed for the \addbeforeocplist-segment
approach. But I hope we can get the more elegant approach working.

Thnx so much for your clarifications, Giuseppe. I'm going to integrate this
into my bigger abstraction project for Arabic and report back, probably later
this week. And I welcome any other comments!

Thnx again
Idris

Just smashing;-)

>
>Working example:
>
>===ocp-work===
>\ocptracelevel=1
>
>% greek ocps
>\ocp\GrTexUni=grpo2uni \ocp\GrUniToFont=uni2greek
>
>%arabic ocps
>\ocp\ArabUni=7arb2uni
>\ocp\UniCUni=uni2cuni
>\ocp\CUniArab=cuni2oar
>
>% abstractions for greek
>\def\GreekFull{%
>                }
>
>% default
>\ocplist\GreekOcp=
>                \nullocplist
>
>% abstraction xperiment 1 % expands the 1'
>\expandafter\expandafter\expandafter\ocplist%
>\expandafter\expandafter\expandafter\MyGreekOcpOne%
>\expandafter\expandafter\expandafter=%
>\expandafter\GreekTranscription%
>\GreekFont
>\nullocplist
>
>% abstraction xperiment 2
>\expandafter\ocplist\expandafter\MyGreekOcpTwo\expandafter=%
>\GreekFull
>\nullocplist
>
>% abstraction xperiment 3
>
>\ocplist\GreekOcpSegmentOne=
>                \nullocplist
>
>\ocplist\GreekOcpSegmentTwo=
>                \nullocplist
>
>\font\greek=omlgc at 12pt
>\greek
>
>%default
>\pushocplist\GreekOcp
>
>a b c d
>
>% xperiment 1
>\clearocplists
>\pushocplist\MyGreekOcpOne
>
>1 a b c d
>
>% xperiment 2
>\clearocplists
>\pushocplist\MyGreekOcpTwo
>
>2 a b c d
>
>% xperiment 3
>\clearocplists
>\pushocplist\GreekOcpSegmentOne
>\pushocplist\GreekOcpSegmentTwo
>
>3 a b c d
>
>% abstraction xperiment for arabic
>
>% default
>\ocplist\ArabicOCP=
>\nullocplist
>
>% abstraction xperiment 4
>\ocplist\ArabicOcpSegmentOne=
>                \nullocplist
>\ocplist\ArabicOcpSegmentTwo=
>                \nullocplist
>\ocplist\ArabicOcpSegmentThree=
>                \nullocplist
>\font\arabic=omarab at 12pt
>\arabic
>\textdir TRT\pardir TRT
>
>% default
>
>\clearocplists
>\pushocplist\ArabicOCP
>
>Aal-Hamdu Aal-Hamdu Aal-Hamdu
>
>\bigskip
>
>% xperiment 4
>\clearocplists
>\pushocplist\ArabicOcpSegmentOne
>\pushocplist\ArabicOcpSegmentTwo
>\pushocplist\ArabicOcpSegmentThree
>
>4 Aal-Hamdu Aal-Hamdu Aal-Hamdu
>
>\bye
>====

`