normalizeToken (src/align.ts)

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

Normalizes tokens by lowercasing, NFKC normalization, and removing non-alphanumeric characters for CJK text alignment

// Source: https://github.com/renezander030/capcut-cli | License: MIT | Copyright 2026 Rene Zander
// Provided via justclaw.it.com; keep this notice with the code.
// Transcript-guided caption alignment (`caption --script`).
//
// Whisper hears the audio; the author already knows what was said. Names,
// product terms, numbers and punctuation are exactly what speech recognition
// gets wrong most often — and the pipelines that most want burned-in captions
// (talking-head shorts, narrated explainers, dubbed courses) usually have the
// script on hand (neo9su/autoclipvideo#174, baizhiheizi/enjoy_player#540 both
// ask for word timing on a KNOWN text rather than a fresh transcription).
// This module keeps whisper's timing and swaps in the script's wording:
//
//   1. tokenise both sides and

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

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

Get a free API key