Repository navigation
Add a pronunciation list - #3
Merged
Merged
Conversation
Under More, Pronunciations, people can add a word and how to say it,
spelled the way it sounds ("Siobhan" as "shiv awn"). A word selected in
the document is filled in, and Listen plays the spelling with the
current voice.
The worker replaces each listed word (whole words, any case, phrases
too) before the G2P and maps the tokens back to the original text, so
word timings and the highlight stay on the word on the page. It applies
to playback, previews and exports. Changing the list drops the cached
audio and restarts from the current word. The list is kept in local
storage.
Version 0.2.0, with a changelog.
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.
Adds a pronunciation list to the web app, for names and terms the voice gets wrong.
What it does
narrata.pronunciations), at most 500 entries. Nothing new goes over the network.How
The worker gets the list in a new
pronunciationsmessage. Before the G2P runs,Pronouncer.rewritereplaces each listed word with its spelling and keeps a map from offsets in the new text to the original. The G2P tokens are mapped back, so every token from a spelling covers the original word.tokenTimingsthen gives that word the start of its first phoneme, as for any other word, and the highlight stays on the word on the page. Kokoro and Piper both go through this function.Version
Bumps the version to 0.2.0 and adds
CHANGELOG.md. After merging I will tagv0.2.0for the extension zip.Checks
tests/pronunciations.test.ts: cleaning the list, whole-word and phrase matching, the offset map, phonemes with the real G2P data, word timings, storage.pnpm test,pnpm typecheck,pnpm build,pnpm build:extandpnpm audit:licensespass locally.durations+tokens). Reading a test text with four entries highlighted all 22 words in order. Changing an entry during playback restarted at the current word and read to the end. A WAV export with the list finished.