Skip to main content

When to use spell()

Wrap a sequence in spell() when the listener needs to hear it one letter or digit at a time, such as a confirmation code they’ll repeat back. spell() works on Coda and the Mist family, and the grouping depends on the model and language. On Coda in English, Rime’s grammar normalizer spells letters straight through, reads up to three digits one at a time, and reads longer digit runs in pairs: spell(jonathan) becomes J-O-N-A-T-H-A-N, and spell(4252528929) becomes “four two, five two, five two, eight nine, two nine”. In other languages on Coda, and on Mist v3, spell() inserts naturalistic pauses, grouping numbers and letters in threes where possible and pairs where necessary. For example, Mist v3 breaks a standard 10-digit telephone number into:
4 2 5 <pause> 2 5 2 <pause> 8 9 <pause> 2 9
The same grouping applies to long words:
P E N <pause> E L O <pause> P E
spell() also inserts pauses when a mixed sequence transitions between letters and numbers:
P R M <pause> 4 2 3 <pause> G D D <pause> M L <pause> 2 <pause> 3 5 4
Any number, letter, or alphanumeric string inside spell() is read in full. The function also reads common symbols such as @ (at) and - (dash). Write the sequence inside spell() without spaces, because a space starts a new group. spell(sasha) is spelled as one group, while spell(S A S H A) is read as five separate letters. To say the word before spelling it, write Sasha, spelled spell(sasha). The /textnorm endpoint shows the grammar normalizer’s reading for the language you pass, which matches Coda’s grouping. Mist v3 can group differently. Each section below shows a Mist v3 reading and the request that produces it, so you can send the same text and listen for the grouping.

spell() applied to words

The eight letters of jonathan split into two groups of three and a pair:
“The name is spelled J O N, A T H, A N.”
Input: the name is spelled spell(jonathan).

spell() applied to numbers

A 10-digit number splits into two groups of three and two pairs:
“The number is 4 2 5, 2 5 2, 8 9, 2 9.”
Input: the number is spell(4252528929).

spell() applied to alphanumeric sequences

In a mixed string, the reading also pauses wherever letters switch to digits or back:
the account is r f, 5, 4 3, d, c, 2
Input: the account is spell(rf543dc2).

spell() applied to typographical symbols

spell() reads these symbols as words, so an email address or handle can go inside a single spell(): For example, help@rime.ai reads as:
the email address is h e, l p, at, r i, m e, dot, a i
Input: the email address is spell(help@rime.ai).