<?tei:SOF p2saat.odd ?>
<!-- $Id: p2saat.odd,v 1.6 1998/02/05 17:14:35 tei Exp $ -->
<!--*
    * $Log: p2saat.odd,v $
    * Revision 1.6  1998/02/05 17:14:35  tei
    * make examples parse
    *
    * Revision 1.5  94/03/27  21:47:19  msmcq
    * Correction of typos found by SJ, DB et al.
    * 
    * Revision 1.4  1994/03/16  03:29:41  msmcq
    * Changes as per JL, with some LB and TL.
    * 
    * Revision 1.3  1994/02/12  10:22:43  lou
    * reviions for P3
    * 
    * Revision 1.2  1993/09/16  19:01:31  msmcq
    * Minor SGML cleanup, add RCS log keyword
    * -->
<!-- Revisions:                                               -->
<!-- 94-03-26 : MSM : typos from HG, DB, SJ                   -->
<!-- 94-03-26 : MSM : disambiguate TERM, Q (> code, ident...) -->
<!-- 94-03-15 : MSM : clean up garbage data                   -->
<!-- 7 feb: LB: sorry, no time to give this the full once-over; -->
<!-- just deleted refs to copyOf and did some perfunctory tidying. -->
<!-- I still think it should be axed for now. -->
<!-- Also had to change attrib names on alt and altGrp to get dtd -->
<!-- to compile: perc -> wScale, excl->mode               -->
<!-- 19 dec 93 : LB change name of classdoc ANA -> cllink -->
<!-- 93-09-15 : MSM : correct typo (SGML detected)            -->
<!-- 93-07-22 : DTL : correct typos                           -->
<!--                  remove percent= from ALTgRP tag         -->
<!-- 93-07-21 : DTL : change argTypes= to targFunc=           -->
<!-- 93-07-12 : DTL : complete draft, fix to conform with new -->
<!--                  tag class definitions                   -->
<!-- 93-07-08 : DTL : start draft                             -->
<!--                  revise material from SAie on movable div2 -->
<!--                  revise "Bloody Mary" TEI-TECH posting,  -->
<!--                  using inclusive alternation, and eliminating -->
<!--                  need for JOIN tags                      -->
 
<div2 id=SAAT><head>Alternation</head>
 
<p>This section proposes elements for the representation of alternation.
We say that two or more elements are in <term>exclusive
alternation</term> if any of those elements could be present in a text,
but one and only one of them is; in addition, we say that those elements
are <term>mutually exclusive</term>.  We say that the elements are in
<term>inclusive alternation</term> if at least one (and possibly more)
of them is present.  The elements that are in alternation may also be
called <term>alternants</term>.
 
<p>The need to mark exclusive alternation arises frequently in text
encoding.  A common situation is one in which it can determined that
exactly one of several different words appears in a given location, but
it cannot be determined which one.  One way to mark such an exclusive
alternation is to use the linking attribute <att>exclude</att>.  Having
marked an exclusive alternation, it can sometimes later be determined
which of the alternants actually appears in the given location.  To
preserve the fact that an alternation was posited, one can add the
linking attribute <att>select</att> to a tag which hierarchically
encompasses the alternants, which points to the one which actually
appears.  To assign responsibility and degree of certainty to the
choice, one can use the <gi>certainty</gi> tag described in chapter
<xref target=CE>.  Also see that chapter for further discussion of
certainty in general.
 
<p>The <att>exclude</att> and <att>select</att> attributes may be used
with any element assuming that they have been declared following the
procedure discussed in the introduction to this chapter.
 
<adList classDoc=CLLINK atts='exclude select'>
 
<p>A more general way to mark alternation, encompassing both exclusive
and inclusive alternation, is to use the linking element <gi>alt</gi>.
The description and attributes of this tag and of the associated
grouping tag <gi>altGrp</gi> are as follows.  These elements are also
members of the <ident type=class>pointer</ident> class and therefore
have all the attributes associated with that class.
 
<!-- except that targFunc and targOrder are pretty meaningless -->
 
<tagList>
<tagDesc tagDoc=ALT atts='targets weights'>
<tagDesc tagDoc=ALTGRP >
</tagList>
 
<!-- suppressed ref to mode, and wscale, which don't seem to  -->
<!-- be in the tagdoc (msm)                                   -->
 
<p>To take a simple hypothetical example, suppose in transcribing a
spoken text, we encounter an utterance that we can understand either as
<cited>We had fun at the beach today.</cited> or as <cited>We had sun at
the beach today.</cited> We can represent the exclusive alternation of
these two possibilities by means of the <att>exclude</att> attribute as
follows.
 
<eg><![ CDATA [
<div>
<!-- ... -->
<u id=WE.fun exclude=we.sun>We had fun at the beach today.</u>
<u id=WE.sun exclude=we.fun>We had sun at the beach today.</u>
<!-- ... -->
</div>
]]>
</eg>
 
<p>If it is then determined that the speaker said <cited>fun</cited>,
not <cited>sun</cited>, the encoder could amend the text by deleting the
alternant containing <cited>sun</cited> and the <att>exclude</att>
attribute on the remaining alternant.  Alternatively, the encoder could
preserve the fact that there was uncertainty in the original
transcription by retaining the alternants, and assigning the
<att>select=we.fun</att> attribute value to the <tag>div</tag> tag that
encompasses the alternants, as in:
 
<eg><![ CDATA [
<div select=we.fun>
<!-- ... -->
<u id=WE.fun exclude=we.sun>We had fun at the beach today.</u>
<u id=WE.sun exclude=we.fun>We had sun at the beach today.</u>
<!-- ... -->
</div>
]]>
</eg>
 
<p>The above alternation (including the <att>select</att> attribute)
could be recoded by assigning the <att>exclude</att> attributes to tags
that enclose just the words or even the characters that are mutually
exclusive, as in:
 
<note place=foot>See section <xref target=AILC> for discussion of the
<tag>w</tag> and <tag>c</tag> tags that can be used in the following
examples instead of the <tag>seg type=word</tag> and <tag>seg
type=character</tag> tags.</note>
 
<eg><![ CDATA [
<div>
<!-- ... -->
<u select=fun>We had
<seg type=word id=FUN exclude=sun>fun</seg>
<seg type=word id=SUN exclude=fun>sun</seg>
at the beach today.</u>
<!-- ... -->
</div>
 
<div>
<!-- ... -->
<u>We had
<seg type=word select=f>
<seg type=character id=F exclude=s>f</seg>
<seg type=character id=S exclude=f>s</seg>
un</seg>
at the beach today.
</u>
<!-- ... -->
</div>
]]>
</eg>
 
<p>Now suppose that the transcriber is uncertain whether the first word
in the utterance is <cited>We</cited> or <cited>Lee</cited>, but is
certain that if it is <cited>Lee</cited>, then the other uncertain word
is definitely <cited>fun</cited> and not <cited>sun</cited>.  The three
utterances that are in mutual exclusion can be encoded as follows.
 
<eg><![ CDATA [
<div>
<!-- ... -->
<u id=WE.fun exclude='we.sun lee.fun'>
We had fun at the beach today.</u>
<u id=WE.sun exclude='we.fun lee.fun'>
We had sun at the beach today.</u>
<u id=LEE.fun exclude='we.fun we.sun'>
Lee had fun at the beach today.</u>
<!-- ... -->
</div>
]]>
</eg>
 
<p>The preceding example can also be encoded with <att>exclude</att>
attributes on the word segments <cited>We</cited>, <cited>Lee</cited>,
<cited>fun</cited> and <cited>sun</cited>:
 
<eg><![ CDATA [
<u>
<seg type=word id=WE exclude=lee>We</seg>
<seg type=word id=LEE exclude='we sun'>Lee</seg>
had
<seg type=word id=FUN exclude=sun>fun</seg>
<seg type=word id=SUN exclude='fun lee'>sun</seg>
at the beach today.</u>
]]>
</eg>
 
<p>The value of the <att>select</att> attribute is defined as a list of
identifiers (<code type=kw>IDREFS</code>); hence it can also be used to
narrow down the range of alternants, as in:
 
<eg><![ CDATA [
<div select='we.fun lee.fun'>
<!-- ... -->
<u id=WE.fun exclude='we.sun lee.fun'>
We had fun at the beach today.</u>
<u id=WE.sun exclude='we.fun lee.fun'>
We had sun at the beach today.</u>
<u id=LEE.fun exclude='we.fun we.sun'>
Lee had fun at the beach today.</u>
<!-- ... -->
</div>
]]>
</eg>
 
This is interpreted to mean that either the first or the third
<tag>u</tag> tag appears, and is thus equivalent to just the alternation
of those two tags:
 
<eg><![ CDATA [
<div>
<!-- ... -->
<u id=WE.fun exclude=lee.fun>We had fun at the beach today.</u>
<u id=LEE.fun exclude=we.fun>Lee had fun at the beach today.</u>
<!-- ... -->
</div>
]]>
</eg>
 
<p>The <att>exclude</att> attribute can also be used in case there is
uncertainty about the tag that appears in a certain position.  For
example, the occurrence of the word <cited>May</cited> in the S-unit
<cited>Let's go to May</cited> can be interpreted, in the absence of
other information, either as a person's name or as a date.  The
uncertainty can be rendered as follows, using the <att>exclude </att>
attribute.
 
<eg><![ CDATA [
<s>Let's go to
<name id=MAYD exclude=mayn>May</name>
<date id=MAYN exclude=mayd copyOf=mayd></date>.</s>
]]>
</eg>
 
<p>Note the use of the <att>copyOf</att> attribute discussed in section
<xref target=SAIE>; this avoids having to repeat the content of the
element whose correct tagging is in doubt.
 
<p>The <att>copyOf</att> and the <att>exclude</att> attributes also
provide for a simple way of indicating uncertainty about exactly where a
particular element occurs in a document.<note>An alternative way of
representing this problem is discussed in chapter <xref
target=CE>.</note> For example suppose that a particular <gi>div2</gi>
element appears either as the third and last of the <gi>div2</gi>
elements within the first <tag>div1</tag> element in the body of a
document, or as the first <gi>div2</gi> of the second <gi>div1</gi>.
One solution would be to record the <gi>div2</gi> in its entirety in the
first of these positions, and a virtual copy of it in the second, and
mark them as excluding each other as follows:
 
<eg rend=skeletal><![ CDATA [
<body>
<div1 id=C1>
 
 <div2 id=C1S3 exclude=c2s1>
  <!-- Text of the "movable" div2 appears here.  -->
 </div2>
 
</div1>
 
<div1 id=C2>
 
 <div2 id=C2S1 copyOf=c1s3 exclude=c1s3></div2>
 
</div1>
 
</body>
]]>
</eg>
 
In this case, the <att>select</att> attribute, if used, would appear on
the <tag>body</tag> tag.
 
<p>Mutual exclusion can also be expressed using a <tag>link</tag>; the
first example in this section can be recoded by removing the
<att>exclude</att> attributes from the <tag>u</tag> tags, and adding a
<tag>link</tag> as follows:  <note place=foot>In this example, we have
placed the <tag>link</tag> next to the tags that represent the
alternants.  It could also have been placed elsewhere in the document,
perhaps within a <tag>linkGrp</tag>.  </note>
 
<eg><![ CDATA [
<div>
<!-- ... -->
<u id=WE.fun>We had fun at the beach today.</u>
<u id=WE.sun>We had sun at the beach today.</u>
<link type='exclusive alternation'
      targType='u u'
      targOrder=N
      targets='we.fun we.sun'>
<!-- ... -->
</div>
]]>
</eg>
 
<p>Now we define the specialized linking element <gi>alt</gi>,making it
a member of the pointer class of elements, and assigning it a
<att>excl</att> (for <cited>mutually exclusive</cited>) attribute, which
can have either of the values <code type=value>Y</code> or <code
type=value>N</code>.  Then the following equivalence holds:
 
<eg rend=formula><![ CDATA [
 <alt mode=excl> = <link type='exclusive alternation'>
]]>
</eg>
 
<p>It is in the nature of alternation that the order of the targets is
irrelevant; hence the <att>targOrder</att> attribute of the
<tag>alt</tag> defaults to the value <code type=value>N</code>.  The
preceding <tag>link</tag> may therefore be recoded as the following
<tag>alt</tag> tag.
 
<eg><![ CDATA [
<alt mode=excl targType='u u' targets='we.fun we.sun'>
]]>
</eg>
 
<p>Other attributes that are defined specifically for the <gi>alt</gi>
element are <att>weights</att> and <att>percent</att>.  The
<att>weights</att> attribute is to be used if one wishes to assign
<term>probabilistic weights</term> to the targets (alternants).  Its
value is a list of numbers, corresponding to the targets, expressing the
probability that each target appears.  The <att>percent</att> attribute
is used to indicate whether the weights are stated as percentages
(<att>percent=Y</att>, the default) or as the actual probabilities
(<att>percent=N</att>).  If the alternants are mutually exclusive, then
the weights must sum to 100% (or 1, if <att>percent=N</att> is
specified).
 
<p>Suppose in the preceding example that it is equiprobable whether
<cited>fun</cited> or <cited>sun</cited> appears.  Then the
<tag>alt</tag> that represents the alternation may be stated as follows:
 
<eg><![ CDATA [
<alt mode=excl
     targType='u u'
     targets='we.fun we.sun'
     weights='50 50'>
]]>
</eg>
 
<p>The assignment of a weight of 100% to one target (and weights of 0%
to all the others) is equivalent to selecting that target.  Thus the
following encoding is equivalent to the second example at the beginning
of this section.
 
<eg><![ CDATA [
<!-- ... -->
<u id=WE.fun>We had fun at the beach today.</u>
<u id=WE.sun>We had sun at the beach today.</u>
<alt mode=excl
     targType='u u'
     targets='we.fun we.sun'
     weights='100 0'>
<!-- ... -->
]]>
</eg>
 
<!-- <p>Inclusive alternation can only be expressed by the    -->
<!-- use of a linking element, either a <tag>link             -->
<!-- type='inclusive alternation'</tag> tag, or an <tag>alt   -->
<!-- excl=N</tag> tag.  For example, suppose in the example   -->
<!-- concerning the <tag>div2</tag> tag that can appear in    -->
<!-- two different places, that it is also possible that it   -->
<!-- appears in both plases.  This situation can be encoded   -->
<!-- as follows.                                              -->
 
<!-- <eg><![ CDATA [ -->
<!-- <body> -->
<!-- <div1 id=C1> -->
<!-- ... -->
<!-- <div2 id=C1S3> -->
<!-- Text of the "copyable" div2 appears here. -->
<!-- </div2> -->
<!-- <div1 id=C2> -->
<!-- <div2 id=C2S1 copyOf=c1s3></div2> -->
<!-- ... -->
<!-- </div1> -->
<!-- ... -->
<!-- </body> -->
<!-- ... -->
<!-- <alt excl=N targType='div2 div2' targets='c1s3 c2s1'> -->
<!-- ]]> -->
<!-- </eg> -->
 
<!-- <p>For inclusive alternation, the <att>weights</att>     -->
<!-- attribute works as follows:  each weight states the      -->
<!-- probability that the target appears given that one or    -->
<!-- more of the other targets appear.  For the current       -->
<!-- example, suppose that the probability that the           -->
<!-- <tag>div2</tag> appears in the first position given      -->
<!-- that it appears in the second position is 20%, but that  -->
<!-- the probability that it appears in the second position   -->
<!-- given that it appears in the first position is 0%.       -->
<!-- Then the preceding <tag>alt</tag> tag can be revised to  -->
<!-- read:                                                    -->
 
<!-- <eg><![ CDATA [ -->
<!-- <alt excl=N targType='div2 div2' targets='c1s3 c2s1' weights='20 0'> -->
<!-- ]]> -->
<!-- </eg> -->
 
The sum of the weights for <tag>alt excl=N</tag> tags ranges from 0% to
(100 x k)%, where k is the number of targets.  If the sum is 0%, then
the alternation is equivalent to exclusive alternation; if the sum is
(100 x k)%, then all of the alternants must appear, and the situation is
better encoded without an <tag>alt</tag> tag.
 
<p>If it is desired, <gi>alt</gi> tags may be grouped together in an
<gi>altGrp</gi> tag, and attribute values shared by the individual
<tag>alt</tag> tags may be identified on the <tag>altGrp</tag> tag.  The
<att>targFunc</att> attribute defaults to the value <code
type=value>'first.alternant next.alternant'</code>.  Thus, specifying
the <att>extendTarg=2</att> attribute value permits the alternants to be
extended indefinitely.
 
<p>To illustrate, consider again the example of a transcribed utterance,
in which it is uncertain whether the first word is <cited>We</cited> or
<cited>Lee</cited>, whether the third word is <cited>fun</cited> or
<cited>sun</cited>, but that if the first word is <cited>Lee</cited>,
then the third word is <cited>fun</cited>.  Now suppose we have the
following additional information:  if <cited>we</cited> occurs, then the
probability that <cited>fun</cited> occurs is 50% and that
<cited>sun</cited> occurs is 50%; if <cited>fun</cited> occurs, then the
probability that <cited>we</cited> occurs is 40% and that
<cited>Lee</cited> occurs is 60%.  This situation can be encoded as
follows.
 
<eg><![ CDATA [
<u>
<seg type=word id=WE exclude=lee>We</seg>
<seg type=word id=LEE exclude=we>Lee</seg>
had
<seg type=word id=FUN exclude=sun>fun</seg>
<seg type=word id=SUN exclude=fun>sun</seg>
at the beach today.</u>
<!-- ... -->
<altGrp targType='seg seg'>
  <alt targets='we lee'>
  <alt targets='fun sun'>
  <alt mode=incl targets='we fun'  weights='50  50'>
  <alt mode=incl targets='Lee fun' weights='100 60'>
  </altGrp>
]]>
</eg>
 
<p>From the information in this encoding, we can determine that the
probability is about 28.5% that the utterance is <q>We had fun at the
beach today</q>, 28.5% that it is <cited>We had sun at the beach
today</cited>, and 43% that it is <cited>Lee had fun at the beach
today</cited>.
 
<!-- MSM:  correct details, please!-- >
 
<p>Another very similar example is the following regarding the text of a
Broadway song.  In three different versions of the song, the same line
reads <q>Her skin is tender as a leather glove,</q> <q>Her skin is
tender as a baseball glove,</q> and <q>Her skin is tender as Dimaggio's
glove.</q><note>The variant readings are found in the commercial sheet
music, the performance score, and the Broadway cast recording.</note>
 
<p>If we wish to express this textual variation using the <gi>alt</gi>
element, we can record our relative confidence in the readings
<cited>Dimaggio's</cited> (with probability 50%), <cited>a
leather</cited> (25%), and <cited>a baseball</cited> (25%).
 
<p>Let us extend the example with a further (imaginary) variation,
supposing for the sake of the argument that the next line is variously
given as <cited>and she bats from right to left</cited> (with
probability 50%) or <cited>now ain't that too damn bad</cited> (with
probability 50%).  Using the <gi>alt</gi> element, we can express the
conviction that if the first choice for the second line is correct, then
the probability that the first line contains <cited>Dimaggio's</cited>
is 90%, and each of the others 5%; whereas if the second choice for the
second line is correct, then the probability that the first line
contains <cited>Dimaggio's</cited> is 10%, and each of the others is
45%.  This can be encoded, with an <tag>altGrp</tag> tag containing a
combination of exclusive and inclusive <tag>alt</tag> tags, as follows.
 
<!-- Bloody Mary, from Rogers & Hammerstein, South Pacific -->
<eg><![ CDATA [
<div id=BM>
<!-- ... -->
<l>Her skin is tender as
<seg id=DM>Dimaggio's</seg>
<seg id=LT>a leather</seg>
<seg id=BB>a baseball</seg>
glove,</l>
<l id=RL>and she bats from right to left.</l>
<l id=DB>now ain't that too damn bad.</l>
<!-- ... -->
</div>
<!-- ... -->
<altGrp>
  <alt mode=excl targType='seg seg'
       targets='dm lt bb' weights='50 25 25'>
  <alt mode=Excl targType='l l'
       targets='rl db' weights='50 50'>
  </altGrp>
<altGrp mode=incl targType='seg l'>
  <alt targets='dm rl' weights='90 90'>
  <alt targets='lt rl' weights='5 5'>
  <alt targets='bb rl' weights='5 5'>
  <alt targets='dm db' weights='10 10'>
  <alt targets='lt db' weights='45 90'>
  <alt targets='bb db' weights='45 90'>
  </altGrp>
]]>
</eg>
 
<p>Here are the formal declarations of the <gi>alt</gi> and
<gi>altGrp</gi> elements.
 
<dtdFrag id=DSAAT n='Alternation'>
<tagDecl tagDoc=ALT>
<tagDecl tagDoc=ALTGRP>
</dtdFrag>
<?tei:EOF p2saat.odd ?>
