Skip to content

Commit 5f4e6da

Browse files
committed
from review of PR #543
1 parent 64bc4ed commit 5f4e6da

File tree

1 file changed

+194
-8
lines changed

1 file changed

+194
-8
lines changed

src/intent.html

Lines changed: 194 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,12 @@ <h3 id="intent_using">Using Intent Concepts and Properties</h3>
371371

372372
<section>
373373
<h3 id="mixing_intent_interpretation">Interpreting intent expressions</h3>
374-
<p>The exact effect of intent expressions on constructed speech or braille is system dependent however
375-
systems should act in a way consistent with the interpretations decribed in this section.</p>
374+
<p>The exact effect of intent expressions on constructed speech or braille is system dependent.
375+
However, systems should act in a way consistent with the interpretations described in this section.</p>
376376
<section>
377377
<h4 id="mixing_intent_multiple properties">Multiple properties</h4>
378378
<p>If multiple properties appear in a [=self-property-list=] or <a
379-
href="#mixing_intent_grammar"><code>term</code></a> then they are
379+
href="#mixing_intent_grammar"><code>term</code></a>, then they are
380380
evaluated left-to right. In general all the properties may have
381381
an effect but in many cases groups of properties all set the same
382382
internal <i>parameter</i> and so their effects are mutually exclusive
@@ -423,22 +423,208 @@ <h4 id="mixing_intent_self_properties">Interpretation of self-properies</h4>
423423
<li>
424424
<code>&lt;mrow
425425
intent=":pause-medium">&lt;mi>x&lt;/mi>...&lt;/mrow></code>
426-
would inicate there should be a pause in speech before the
426+
would inidcate there should be a pause in speech before the
427427
<code>mrow</code> is procesed (it would not cause a pause before
428-
all descentant elements.
428+
all descentant elements).
429429
</li>
430430
<li><code>&lt;mrow
431431
intent=":literal">&lt;mi>x&lt;/mi>...&lt;/mrow></code>
432432
would set the <i>parameter</i> corresponding to the default intent inference
433-
rules to <code>literal</code> this would cause the intent for this
434-
<code>mrow</code> including all its descendants to use the
433+
rules to <code>literal</code>. This would cause the intent for this
434+
<code>mrow</code>, including all its descendants to use the
435435
<code>literal</code> rules for inferring intent unless they have
436436
an explicit intent or use another [=self-property=] such as
437437
<code>:common</code> to over-ride this.</li>
438438
</ul>
439439
</section>
440-
441440

441+
<section class="fold">
442+
<h4 id="mixing_intent_interpreting_examples">Examples</h4>
443+
444+
<dl>
445+
<dt>factorial</dt>
446+
<dd>
447+
<pre>
448+
&lt;mrow intent="$xf:prefix">
449+
&lt;mrow arg="xf" intent="$f:function($x)">
450+
&lt;mi arg="x">x&lt;/mi>&lt;mo arg="f" intent="factorial:suffix">!&lt;/mo>
451+
&lt;/mrow>
452+
&lt;/mrow>
453+
</pre>
454+
<p>Expanding out all the references leads to</p>
455+
<pre>
456+
&lt;mrow intent="factorial:suffix:function:prefix(_x)">
457+
&lt;mrow arg="xf" intent="factorial:suffix:function(_x)">
458+
&lt;mi arg="x">x&lt;/mi>&lt;mo arg="f" intent="factorial:suffix">!&lt;/mo>
459+
&lt;/mrow>
460+
&lt;/mrow>
461+
&lt;/mrow>
462+
</pre>
463+
<p>The entire expression would be read based on the intent of the first mrow, which is equivalent to <code>factorial:prefix(_x)</code> so read as <q>factorial x</q>.
464+
</p>
465+
</dd>
466+
<dt>common/literal</dt>
467+
<dd>
468+
<pre>
469+
&lt;mrow intent=":common">
470+
&lt;msup>&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
471+
&lt;mo>+&lt;/mo>
472+
&lt;mrow intent=":literal">
473+
&lt;msup>&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
474+
&lt;/mrow>
475+
&lt;mo>+&lt;/mo>
476+
&lt;msup>&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
477+
&lt;/mrow>
478+
&lt;/mrow>
479+
</pre>
480+
481+
<p>Here the first mrow sets the default rules to common for the scope of that element so the first msup, having no intent is interpreted as power and read as x squared</p>
482+
483+
<p>The second mrow sets the default rules to literal for the scope of that element so the second msup having no intent is read as x superscript 2</p>
484+
485+
<p>The final msup is again in the scope of common so read as x squared</p>
486+
487+
<p>Note that the effect of these :common and :literal properties as setting the default rules for elements with no intent
488+
are part of the property description there is no separate classification needed of properties. The fact that they set the same
489+
internal default rule parameter also explains why they are mutually exclusive, just as fixity properties such as :prefix and :suffix set the same "fixity" parameter and so just one can have an effect on any term.</p>
490+
</dd>
491+
492+
<dt>system-of-equations/matrix</dt>
493+
<dd>
494+
<pre>
495+
&lt;mtable intent=":system-of-equations">
496+
&lt;mtr>
497+
&lt;mtd>
498+
&lt;mo>(&lt;/mo>
499+
&lt;mtable intent=":matrix">&lt;mtr>&lt;mtd>&lt;mn>1&lt;/mn>&lt;/mtd>&lt;mtd>&lt;mn>2&lt;/mn>&lt;/mtd>&lt;/mtr>&lt;/mtable>
500+
&lt;mo>)&lt;/mo>
501+
&lt;/mtd>
502+
&lt;mtd>
503+
&lt;mo>+&lt;/mo>
504+
&lt;/mtd>
505+
&lt;mtd>
506+
&lt;mo>(&lt;/mo>
507+
&lt;mtable intent=":matrix">&lt;mtr>&lt;mtd>&lt;mn>2&lt;/mn>&lt;/mtd>&lt;mtd>&lt;mn>3&lt;/mn>&lt;/mtd>&lt;/mtr>&lt;/mtable>
508+
&lt;mo>)&lt;/mo>
509+
&lt;/mtd>
510+
&lt;mtd>
511+
&lt;mo>=&lt;/mo>
512+
&lt;/mtd>
513+
&lt;mtd>
514+
&lt;mo>(&lt;/mo>
515+
&lt;mtable intent=":matrix">&lt;mtr>&lt;mtd>&lt;mn>3&lt;/mn>&lt;/mtd>&lt;mtd>&lt;mn>5&lt;/mn>&lt;/mtd>&lt;/mtr>&lt;/mtable>
516+
&lt;mo>)&lt;/mo>
517+
&lt;/mtd>
518+
&lt;/mtr>
519+
&lt;/mtable>
520+
</pre>
521+
<p>Here the first mtable will be read as a system of equations, (only one unlabelled equation here so probably: one equation:...
522+
the :system-of-equations property is defined to only affect the current mtable
523+
the nested mtable are not affected by the outer :system-of-equation property and are read using the :matrix property so the overall reading is</p>
524+
<pre>
525+
1 line
526+
the 1 by 2 row matrix 1 2
527+
plus
528+
the 1 by 2 row matrix 2 3
529+
is equal to
530+
the 1 by 2 row matrix 3 5
531+
</pre>
532+
</dd>
533+
<dt>functional head</dt>
534+
<dd>
535+
<pre>
536+
&lt;mrow intent="$op:infix($x,$y)">
537+
&lt;mi arg="x">x&lt;/mi>
538+
&lt;msup arg="op" intent="converse:postfix(L)">
539+
&lt;mi>R&lt;/mi>
540+
&lt;mi>T&lt;/mi>
541+
&lt;/msup>
542+
&lt;mi arg="y">y&lt;/mi>
543+
&lt;/mrow>
544+
</pre>
545+
<p>this would be equivalent to</p>
546+
<pre>
547+
&lt;mrow intent="converse:postfix(L):infix(_x,_y)">
548+
&lt;mi arg="x">x&lt;/mi>
549+
&lt;msup arg="op" intent="converse:postfix(L)">
550+
&lt;mi>R&lt;/mi>
551+
&lt;mi>T&lt;/mi>
552+
&lt;/msup>
553+
&lt;mi arg="y">y&lt;/mi>
554+
&lt;/mrow>
555+
</pre>
556+
<p>so read as x L converse y (with :infix applying to L converse). This would match the reading obtained by removing the first intent and simply reading the child elements in order.</p>
557+
</dd>
558+
<dt>pause</dt>
559+
<dd>
560+
<pre>
561+
&lt;mrow>
562+
&lt;mrow>
563+
&lt;mi>a&lt;/mi>&lt;mi>b&lt;/mi>
564+
&lt;/mrow>
565+
&lt;mrow intent=":pause-long">
566+
&lt;mi>c&lt;/mi>&lt;mi>d&lt;/mi>
567+
&lt;/mrow>
568+
&lt;/mrow>
569+
</pre>
570+
<p>This reads as a b pause c d</p>
571+
572+
<p>Note that on the self property :pause-long just acts once, it has
573+
no effect on descendants of the element on which it was applied.</p>
574+
</dd>
575+
<dt>ref to common</dt>
576+
<dd>
577+
<pre>
578+
&lt;mrow intent="wibble($a,$b,$c)">
579+
&lt;msup arg="a" intent=":common">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
580+
&lt;mo>+&lt;/mo>
581+
&lt;msup arg="b" intent=":literal">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
582+
&lt;mo>+&lt;/mo>
583+
&lt;msup arg="c">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
584+
&lt;/mrow>
585+
</pre>
586+
<p>Here the referenced elements have no intent, or intents just
587+
consisting of self-properties so the effective intent in each case is
588+
system specific speech string but controlled by the "common" rules in
589+
the first case, the "literal" rules in the second, and by the "legacy"
590+
rules in the third, resulting in the following (assuming the legacy
591+
reading is the same as common here)</p>
592+
<pre>
593+
&lt;mrow intent="wibble(_x_squared,x_superscript_2,_x_squared)">
594+
&lt;msup arg="a" intent=":common">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
595+
&lt;mo>+&lt;/mo>
596+
&lt;msup arg="b" intent=":literal">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
597+
&lt;mo>+&lt;/mo>
598+
&lt;msup arg="c">&lt;mi>x&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>
599+
&lt;/mrow>
600+
</pre>
601+
<p>which would be read as</p>
602+
603+
<p>wibble of x squared comma supercript two comma x squared</p>
604+
</dd>
605+
<dt>compound units</dt>
606+
<dd>
607+
<pre>
608+
&lt;mrow intent=":unit">
609+
&lt;mi>W&lt;/mi>
610+
&lt;mo>/&lt;/mo>
611+
&lt;msup>
612+
&lt;mi>m&lt;/mi>
613+
&lt;mn>2&lt;/mn>
614+
&lt;/msup>
615+
&lt;/mrow>
616+
</pre>
617+
<p>there the :unit property sets the default interpretation to be
618+
"unit style" for the scope of the mrow the exact words used are as
619+
always system dependent but typically <code>&lt;mi>W&lt;/mi></code>
620+
will be read as Watts and <code>&lt;mo>/&lt;/mo></code> as per so</p>
621+
622+
<p>Watts per square metre</p>
623+
</dd>
624+
</dl>
625+
626+
</section>
627+
442628
</section>
443629
<section>
444630
<h3 id="mixing_intent_errors">Intent Error Handling</h3>

0 commit comments

Comments
 (0)