New version of rule for <munder>

Open Beginner friendly
#613 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
xml, yaml
Domain
accessibility

Research direction

Start in default.yaml at the existing munder speaking rule and compare it with the Swedish rule described in the issue. Use the nested MathML example to check that speech is less verbose while the brace remains available during navigation; done means the English rule provides the proposed equivalent behavior.

Written by the indexing model from the issue text.

Description

discussion rules

In default.yaml there is a rule for speaking <munder>. In cases where there are nested <munder>s, such as the following,

<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML">
          <munder>
            <mrow>
              <munder>
                <mrow>
                  <mn>2</mn>
                  <mo>,</mo>
                  <mn>7</mn>
                  <mo>,</mo>
                  <mn>12</mn>
                  <mo>,</mo>
                  <mn>17</mn>
                  <mo>,</mo>
                  <mo>…</mo>
                  <mo>,</mo>
                  <mn>n</mn>
                  <mo>+</mo>
                  <mn>5</mn>
                </mrow>
                <mo>⏟</mo>
              </munder>
            </mrow>
            <mi mathvariant="normal">N</mi>
          </munder>
        </math>

the speaking is exceedingly verbose. In this case it would read "quantity quantity, 2 comma 7 [...] plus 5, with bottom brace below, with N below".

In Swedish, I have modified this rule so that it says the equivalent of "commented expression, 2 comma 7 [...] plus 5, with comment below, N, end comment". The bottom brace will be spoken only in navigation.

The new Swedish rule looks like this (translated into English here):

- name: default
  tag: munder
  match: "."
  replace:
  - with:
      variables:
      # true if the comment contains ⏟ or ︸ (also if inside mrow or surrounded by whitespace)
      - HasBrace: "contains(normalize-space(string(*[2])), '⏟') or contains(normalize-space(string(*[2])), '︸')"
      replace:
      - test:
          if: "$HasBrace"
          then:
            # The base is always read
            - x: "*[1]"
            - pause: short
            # Read the brace (good for navigation) but no framing phrases
            - x: "*[2]"
          else:
            # Frame phrase in the beginning if the base is not leaf
            - test:
                if: "not(IsNode(*[1], 'leaf'))"
                then: [T: "commented expression"]
            - x: "*[1]"
            - pause: short
            - T: "with comment below"
            - pause: short
            - x: "*[2]"
            - pause: short
            - T: "end comment"

If others agree that this is a better solution, I would suggest substituting the English rule for this.

Dominant language
Rust
Stars
114
Forks
85
Avg merge
1d 16h
Merged PRs (30d)
42

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from daisy/MathCAT

All issues in daisy/MathCAT

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.