From cb93e856d59e3045c08937dca5e7d14f8aab0c44 Mon Sep 17 00:00:00 2001 From: Evan Liu Date: Mon, 1 Jun 2026 12:24:04 -0700 Subject: [PATCH 1/2] Add alternatives considered for automatic punctuation Added a section discussing alternatives considered for enabling automatic punctuation by default in SpeechRecognition. --- explainers/unspoken-punctuation.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/explainers/unspoken-punctuation.md b/explainers/unspoken-punctuation.md index 6a19d0a..2efb33e 100644 --- a/explainers/unspoken-punctuation.md +++ b/explainers/unspoken-punctuation.md @@ -53,6 +53,15 @@ recognition.onresult = (event) => { recognition.start(); ``` +## Alternatives Considered + +### Enabling Automatic Punctuation by Default +Instead of introducing the new `unspokenPunctuation` configuration option, we considered simply enabling automatic punctuation by default for all `SpeechRecognition` sessions. + +* **Why it was rejected:** The primary blocker for this approach is backward compatibility. Existing developers and applications relying on the Web Speech API expect the traditional behavior of raw, unpunctuated text. Changing the default output would likely break downstream text processing, custom formatting logic, or applications that explicitly require verbatim, unpunctuated dictation. + +By introducing this as an opt-in boolean attribute, we maintain stability for existing applications while providing the flexibility modern developers need. This approach also follows strong industry precedent; major speech recognition providers, such as [Azure Speech Service](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/display-text-format?pivots=programming-language-python) and [Google Cloud Speech-to-Text](https://docs.cloud.google.com/speech-to-text/docs/automatic-punctuation), similarly implement automatic punctuation as a configurable option rather than a forced default. + ### Note on Automatic Capitalization In many modern speech-to-text engines, automatic punctuation is tightly coupled with automatic capitalization. When `unspokenPunctuation` is set to `true`, developers should expect that the underlying recognition engine may also automatically capitalize the first word following an inferred sentence-ending punctuation mark (e.g., a period or question mark). Because this behavior depends on the specific platform and OS implementation, developers should not assume the resulting text will remain strictly lowercase when this flag is enabled. From 386b9214019e23322cbf1d398aded84de702482d Mon Sep 17 00:00:00 2001 From: Evan Liu Date: Tue, 2 Jun 2026 10:35:39 -0700 Subject: [PATCH 2/2] Update unspoken-punctuation.md --- explainers/unspoken-punctuation.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/explainers/unspoken-punctuation.md b/explainers/unspoken-punctuation.md index 2efb33e..0b51bbd 100644 --- a/explainers/unspoken-punctuation.md +++ b/explainers/unspoken-punctuation.md @@ -62,7 +62,9 @@ Instead of introducing the new `unspokenPunctuation` configuration option, we co By introducing this as an opt-in boolean attribute, we maintain stability for existing applications while providing the flexibility modern developers need. This approach also follows strong industry precedent; major speech recognition providers, such as [Azure Speech Service](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/display-text-format?pivots=programming-language-python) and [Google Cloud Speech-to-Text](https://docs.cloud.google.com/speech-to-text/docs/automatic-punctuation), similarly implement automatic punctuation as a configurable option rather than a forced default. -### Note on Automatic Capitalization +## Implementation Notes + +### Automatic Capitalization In many modern speech-to-text engines, automatic punctuation is tightly coupled with automatic capitalization. When `unspokenPunctuation` is set to `true`, developers should expect that the underlying recognition engine may also automatically capitalize the first word following an inferred sentence-ending punctuation mark (e.g., a period or question mark). Because this behavior depends on the specific platform and OS implementation, developers should not assume the resulting text will remain strictly lowercase when this flag is enabled. ### Internationalization