ref: https://docs.google.com/document/d/1GzVgbwcldWAP3l6yc3KLSRy4rr_qRusEE566viui0_o/edit#
The Pronunciation Task Force (TF) has evaluated multiple approaches to pronunciation and summarized their analysis in the Gap Analysis. The ARIA proposal, through an aria-pronouce
attribute, provides an improved technique for authors to correct pronunciation and substitution.
However, we believe with slight modifications, the ARIA proposal could also achieve similar results for additional, priorty features. The priority features identified by the Pronunciation TF are:
- Language (covered by HTML and RFC 5646 with possible modifications for historical variants, dialects, etc.)
- Phonetic Pronunciation (covered by the core of the ARIA proposal)
- Substitution
- Say As
- Pausing (Break)
For substitution, the alias
key could indicate an expansion.
<script>
document.pronunciationDict = {
"en-US": {
"W3C": {
"alias": "World Wide Web Consortium"
}
}
};
</script>
<span aria-pronounce="alias">W3C</span>
For say-as, the interpret-as
value can be used to key different pronunciations. This does not address parsing of various formats, such as date or currency.
<script>
document.pronunciationDict = {
"en-US": {
"10": {
"characters": "1 0",
"ordinal": "tenth",
"cardinal": "ten"
},
"λ": {
"symbol": "lambda"
},
"Ω": {
"symbol": /oʊˈmeɪɡə/
}
}
};
</script>
<span aria-pronounce="characters">10</span>
<span aria-pronounce="ordinal">10</span>
<span aria-pronounce="cardinal">10</span>
<span aria-pronounce="symbol">λ</span>
<span aria-pronounce="symbol">Ω</span>
For pausing, common punctuation or other characters could map to pauses but this would require a different notation from the phonetic and ipa notations used in the other examples.
<script>
document.pronunciationDict = {
"en-US": {
"...": {
"break": "[250ms]"
}
}
};
</script>
We will put it by, that when he comes again<span aria-pronounce="break">...</span> But it may be months, perhaps, before THAT happens.
It's unclear, from the ARIA proposal, if ,
was keyed into the dictionary and the entire example was wrapped with <div aria-pronounce="break">
whether or not the individual commas would get parsed. For now, it's assumed that each comma would need to be separately wrapped to ensure the proper timing.
In the previous example (Jane Austen’s Sense and Sensibility), "THAT" should be read with emphasis. However, not only would creating such a key/value pair require a new notation for emphasis (e.g., {{THAT}}
), any emphasized text would need to be added to the dictionary even if no pronunciation hint is needed. A SENTENCE WITH EVERY WORD HIGHLIGHTED (to quote a recent commercial), would require significant markup and thus, this probably isn't the proper technique.
If there were a substitution notation, like for RegExp, perhaps there could still be a solution using this proposal. It might look like this: $emphasize': '{{$}}'
where any text wrapped with <span aria-pronounce="$emphasize">
leaves the content unaltered. Like other voice changes (gender, age, emotion), this notation could be independant from locale and/or apply to multiple locales.
<script>
document.pronunciationDict = {
"$": {
"$emphasize": "{{$}}",
"$whisper": "}}${{"
}
"en-US": {
"...": {
"break": "[250ms]"
}
}
};
</script>
We will put it by, that when he comes again<span aria-pronounce="break">...</span> But it may be months, perhaps, before <span aria-pronounce="$emphasize">THAT</span> happens.
See https://www.internationalphoneticassociation.org/sites/default/files/extIPAChart2008.pdf