feat: X-SAMPA / Praat / SIL / Branner → IPA phonetic-alphabet modifiers#2
Merged
Conversation
Adds four new text-modifier keys — xsampa, praat, sil, branner — that
translate to Unicode IPA via the ipa-translate crate and emit the same
<phoneme alphabet="ipa" ph="…">text</phoneme> shape as the existing ipa:
modifier. Sits behind a default-on `phonetic-translation` feature so
downstream consumers can opt out of the extra dependency.
Example:
(pecan)[xsampa:"'pi.k{n"]
→ <phoneme alphabet="ipa" ph="ʲpi.kæn">pecan</phoneme>
(hello)[xsampa:"h@"loU"]
→ <phoneme alphabet="ipa" ph="həˈloʊ">hello</phoneme>
Google strips the phoneme tag (mirrors existing ipa: behaviour); Alexa
and Azure emit it. Conversion is infallible per upstream — invalid
source produces garbage IPA, matching how ipa: passes its value through
unvalidated today.
Integration test skips the new fixtures when the feature is off so
both feature configurations stay green. Submodule pointer bumped to
the matching commit on willwade/speechmarkdown-test-files@feat/expand-test-fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four new SpeechMarkdown text-modifier keys —
xsampa,praat,sil,branner— that translate to Unicode IPA via theipa-translatecrate and emit the same<phoneme alphabet=\"ipa\" ph=\"…\">text</phoneme>shape as the existingipa:modifier. Sits behind a default-onphonetic-translationCargo feature so downstream consumers can opt out of the extra dependency.ipa:behaviour); Alexa and Azure emit it.ipa:passes its value through unvalidated today.willwade/speechmarkdown-test-files@feat/expand-test-fixtures(six new directories:xsampa-standard,xsampa-stress,praat-standard,sil-standard,branner-standard,combo-xsampa-emphasis).Test plan