Draft
Conversation
Contributor
Author
|
@longcw one thing: not sure if we need to enable some of these things by default |
Hormold
commented
Nov 14, 2025
|
|
||
| # Preserve years | ||
| if 1900 <= num <= 2099: | ||
| return str(num_str) |
Contributor
Author
There was a problem hiding this comment.
maybe we need split it: 2020 -> 20 20
Hormold
commented
Nov 14, 2025
| Format dollar amounts for TTS: | ||
| - $5 -> "five dollars" | ||
| - $12.50 -> "twelve dollars and fifty cents" | ||
| - $0.023 -> "zero point zero two three dollars" (speaks out each decimal digit) |
Contributor
Author
There was a problem hiding this comment.
thinking - maybe should we go deeper and convert it to - "zero pint zero twenty three dollars"?
Hormold
commented
Nov 14, 2025
| async def format_phone_numbers(text: AsyncIterable[str]) -> AsyncIterable[str]: | ||
| """ | ||
| Format phone numbers for TTS: | ||
| - 555-123-4567 -> "5 5 5 1 2 3 4 5 6 7" |
Contributor
Author
There was a problem hiding this comment.
this is only for US phone numbers. should we cover +1 phone numbers also?
longcw
reviewed
Nov 15, 2025
| from typing import Literal, Optional, Union | ||
|
|
||
| # Number to word mappings for TTS preprocessing | ||
| ONES = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] |
Contributor
There was a problem hiding this comment.
I think we move these to a separate file, also the markdown and emoji filters can move to files since we are going to have more transforms.
8 tasks
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.
Additional TTS preprocessing for: