Skip to content

Support the print and speak lines from SpeakableString in icu::message2 #186

@grhoten

Description

@grhoten

This may be architecturally hard to support in icu::message2, but it would be helpful to support formatting of SpeakableString. There are cases where you need to print the text, or speak the text, or both. It's impossible to perfectly get ambiguous text perfectly spoken, or spoken text perfectly transcribed. You sometimes need to give a little guidance or provide an explicit way to speak or print text.

SSML provides a way to annotate text for proper speaking of the printed text, but it works best when the text is fully known at build time. It works less well for variables. Think of SSML as something similar to CSS for text. You're providing the style of how to speak instead of style to print.

As an example, how would someone pronounce "$1.23". If I'm referring to a US speaker in the US region talking about US dollar quantities, I'd say "one dollar and twenty three cents". If the same person were actually talking about Canadian dollars, I'd more likely want to disambiguate the pronunciation as "one Canadian dollar and twenty three cents". The opposite would happen if I swapped roles and currencies.

The normal process for the Unicode Inflection usage is to format and modify each segment as each part is being generated. It's not to format it twice, or print the whole thing and then speak the whole. It's to do both at the same time, and concatenate the SpeakableString.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions