Skip to content

fix(helpers): match pronunciation terms with punctuation - #820

Open
Apeksha9389 wants to merge 1 commit into
deepgram:mainfrom
Apeksha9389:fix/pronunciation-token-boundaries
Open

Apeksha9389 wants to merge 1 commit into
deepgram:mainfrom
Apeksha9389:fix/pronunciation-token-boundaries

Conversation

@Apeksha9389

Copy link
Copy Markdown

Summary

Match pronunciation terms at token boundaries rather than requiring a regex word boundary at each end. This lets add_pronunciation replace punctuated names such as C++, C# and .NET, while leaving longer tokens such as C++17, C#script and ASP.NET intact.

For example, add_pronunciation("Use C++ today.", "C++", "test") now emits a pronunciation control instead of leaving the term unchanged. Matching remains case-sensitive, literal and limited to the first occurrence.

Validation

  • 79 related helper and client-construction tests pass.
  • Six new cases fail on current main and pass with the fix; an additional embedded-token control passes on both.
  • Ruff checks, formatting of the new tests, mypy for the helper, and whitespace checks pass.
  • Changes are confined to the hand-written helper, custom regressions and their .fernignore entry.

AI-assisted implementation and regression tests. These custom tests make no provider requests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant