diff --git a/stackvox/text.py b/stackvox/text.py index 3675c91..69b1ec0 100644 --- a/stackvox/text.py +++ b/stackvox/text.py @@ -133,14 +133,15 @@ def apply_pronunciations(text: str, mapping: dict[str, str] | None) -> str: "cli": "C L I", "ci": "C I", "ide": "I D E", - "aws": "A W S", + "aws": "A.W.S.", # dotted: espeak reads a lone "A" as the article "uh"; dots force the letter name "ay" "uri": "U R I", - "iam": "I A M", + "iam": "I.A.M.", # ditto — the middle "A" needs the dot "saas": "sass", "paas": "pass", "tui": "T U I", "postgresql": "postgres", "kubectl": "kube control", + "stackone": "stack one", # org name espeak garbles as "stac kone" } diff --git a/tests/test_text.py b/tests/test_text.py index 6206c8f..6e44cc2 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -226,11 +226,17 @@ def test_plain_text_mode_splits_paragraphs(): def test_dev_acronyms_are_spelled_out(): assert normalize_for_speech("Use the CLI.", markdown=False) == "Use the C L I." assert "C L I" in normalize_for_speech("the cli tool", markdown=False) # lowercase too - assert "A W S" in normalize_for_speech("deploy to AWS", markdown=False) + assert "A.W.S." in normalize_for_speech("deploy to AWS", markdown=False) # dotted → "ay" + assert "I.A.M." in normalize_for_speech("set up IAM", markdown=False) assert "U R I" in normalize_for_speech("parse the URI", markdown=False) assert "C I C D" in normalize_for_speech("the CI/CD pipeline", markdown=False) +def test_org_names_are_spoken_word_by_word(): + assert "stack one" in normalize_for_speech("deployed to StackOne today", markdown=False) + assert "stack one" in normalize_for_speech("the stackone api", markdown=False) # case-insensitive + + def test_dev_terms_leave_correctly_voiced_acronyms_alone(): out = normalize_for_speech("Send JSON over HTTP to the API.", markdown=False) assert "JSON" in out