Pronunciation dictionaryPro
Word to phoneme or alias rules with a test play per row.
On this page
ProSeven rules with a duplicate and unwrapped IPA flagged; play any row.
Installation
Usage
import { PronunciationDictionary } from "@/components/ui/chatcn/pro/pronunciation-dictionary"
<PronunciationDictionary rules={rules} onRulesChange={setRules} onTest={speak} onStop={stop} />Say as swaps in another spelling; IPA gives exact sounds wrapped in slashes. The same word twice is flagged with the row it clashes with, since the first rule wins. Pass onTest to play a row through your voice; omit onRulesChange for a read only list.
Examples
States
ProRead only, a voice that fails, and no rules yet.
Props
| Prop | Type | Notes |
|---|---|---|
rules, onRulesChange | { id, word, kind, value }[] | kind is alias or phoneme |
onTest | (rule) => Promise<void> | Resolve when playback ends |
onStop | () => void | Stops the playing row |
Accessibility
- Every field is named by its row; the play button names the word and turns into Stop while playing.
- Checks show an icon and a sentence that says how to fix them.