You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/assistants/voice-formatting-plan.mdx
+15-126
Original file line number
Diff line number
Diff line change
@@ -20,132 +20,21 @@ You can turn off formatting if you want the TTS to read the raw LLM output.
20
20
21
21
When enabled, the formatter runs a series of transformations on your text, each handled by a specific function. Here's the order and what each function does:
22
22
23
-
<Steps>
24
-
25
-
<Steptitle="removeAngleBracketContent">
26
-
Removes anything in `<...>`, except for `<break>`, `<spell>`, or double angle brackets `<< >>`.
27
-
28
-
**Example:**
29
-
```
30
-
Hello <tag> world
31
-
**Wanted** to say *hi*
32
-
...
33
-
```
34
-
Becomes:
35
-
```
36
-
Hello world
37
-
**Wanted** to say *hi*
38
-
...
39
-
```
40
-
</Step>
41
-
42
-
<Steptitle="removeMarkdownSymbols">
43
-
Removes markdown characters like `_`, `` ` ``, and `~`. Some versions also remove double asterisks, but that might happen in the next step.
44
-
45
-
**Example:**
46
-
```
47
-
**Wanted** to say *hi*
48
-
```
49
-
If only `_`, backticks, and tildes are removed, asterisks remain for now.
50
-
</Step>
51
-
52
-
<Steptitle="removePhrasesInAsterisks">
53
-
Removes text wrapped in single or double asterisks.
54
-
55
-
**Example:**
56
-
```
57
-
**Wanted** to say *hi*
58
-
```
59
-
Becomes:
60
-
```
61
-
to say
62
-
```
63
-
</Step>
64
-
65
-
<Steptitle="replaceNewLinesWithPeriods">
66
-
Converts line breaks to periods for smoother speech.
67
-
68
-
**Example:**
69
-
```
70
-
Hello world\n to say\nWe have NASA and .NET here,\ncall me at 123-456-7890,\nprice: $42.50\nand the date is 2023 05 10\nand time is 14:00\nDistance is 5km\nWe might see 9999\nthe address is 320 ST 21 RD\nmy email is JOHN.DOE@example.COM
71
-
```
72
-
Becomes:
73
-
```
74
-
Hello world . to say . We have NASA and .NET here, call me at 123-456-7890, price: $42.50 and the date is 2023 05 10 and time is 14:00 Distance is 5km We might see 9999 the address is 320 ST 21 RD my email is JOHN.DOE@example.COM
75
-
```
76
-
</Step>
77
-
78
-
<Steptitle="replaceColonsWithPeriods">
79
-
Replaces `:` with `.` for better phrasing.
80
-
81
-
**Example:**
82
-
```
83
-
price: $42.50
84
-
```
85
-
Becomes:
86
-
```
87
-
price. $42.50
88
-
```
89
-
</Step>
90
-
91
-
<Steptitle="formatAcronyms">
92
-
Converts known acronyms to lowercase or spaces out unknown all-caps words. If it's all-caps but not recognized, it might get spaced letters. If it has vowels, it's left alone.
93
-
94
-
**Example:**
95
-
- `NASA` → `nasa`
96
-
- `.NET` → `.net`
97
-
</Step>
98
-
99
-
<Steptitle="formatDollarAmounts">
100
-
Expands currency to words.
101
-
102
-
**Example:**
103
-
- `$42.50` → "forty two dollars and fifty cents"
104
-
</Step>
105
-
106
-
<Steptitle="formatEmails">
107
-
Replaces `@` with "at" and `.` with "dot" in email addresses.
108
-
109
-
**Example:**
110
-
- `JOHN.DOE@example.COM` → `JOHN dot DOE at example dot COM`
| 1 |`removeAngleBracketContent`| Removes anything within `<...>`, except for `<break>`, `<spell>`, or double angle brackets `<< >>`. |`Hello <tag> world`|`Hello world`|
26
+
| 2 |`removeMarkdownSymbols`| Removes markdown symbols like `_`, `` ` ``, and `~`. Asterisks (`*`) are preserved in this step. |`**Wanted** to say *hi*`|`**Wanted** to say *hi*`|
27
+
| 3 |`removePhrasesInAsterisks`| Removes text surrounded by single or double asterisks. |`**Wanted** to say *hi*`|` to say`|
28
+
| 4 |`replaceNewLinesWithPeriods`| Converts new lines (`\n`) to periods for smoother speech. |`Hello world\n to say\nWe have NASA`|`Hello world . to say . We have NASA`|
29
+
| 5 |`replaceColonsWithPeriods`| Replaces `:` with `.` for better phrasing. |`price: $42.50`|`price. $42.50`|
30
+
| 6 |`formatAcronyms`| Converts known acronyms to lowercase (e.g., NASA → nasa) or spaces out unknown all-caps words unless they contain vowels. |`NASA and .NET`|`nasa and .net`|
31
+
| 7 |`formatDollarAmounts`| Converts currency amounts to spoken words. |`$42.50`|`forty two dollars and fifty cents`|
32
+
| 8 |`formatEmails`| Replaces `@` with "at" and `.` with "dot" in emails. |`JOHN.DOE@example.COM`|`JOHN dot DOE at example dot COM`|
33
+
| 9 |`formatDates`| Converts date strings into spoken date format. |`2023 05 10`|`Wednesday, May 10, 2023`|
34
+
| 10 |`formatTimes`| Expands or simplifies time expressions. |`14:00`|`14`|
| 12 |`formatNumbers`| Formats general numbers: years read as digits, large numbers spelled out, negative and decimal numbers clarified. |`-9`, `2.5`, `2023`|`minus nine`, `two point five`, `2023`|
37
+
| 13 |`Applying Replacements`| Applies user-defined final replacements like expanding street abbreviations. |`320 ST 21 RD`|`320 STREET 21 ROAD`|
0 commit comments