parseLexicon (src/lexicon.ts)

capcut-cli · src/lexicon.ts · typescript · MIT
voice

Parses TTS lexicon rules to rewrite speech output pronunciation.

// Source: https://github.com/renezander030/capcut-cli | License: MIT | Copyright 2026 Rene Zander
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Pronunciation lexicon for `tts --lexicon`: rewrite only the text handed to
 * the TTS engine ("Nguyen" -> "Win"), never what the draft shows.
 *
 * Matching is leftmost-longest over the source text. A rule whose first/last
 * character is a word character (letter, digit, mark, underscore) only matches
 * where the neighbouring text character is not one, so "SQL" never fires inside
 * "MySQLite". CJK scripts have no word boundaries: CJK characters neither need
 * nor block a boundary, so a CJK rule matches anywhere and "SQL" still matches
 * in "我用SQL". Offsets are JS string (UTF-16 code unit) indices into the
 * source te

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key