abchapterize 0.12.0
Books that count from one again in every part, phrases that say what they are looking for, and a command of your own around each file.
A feature release on top of 0.11.0. New here? The README explains what ABChapterize is for. What follows is what changed.
Books divided into parts are marked in full
Some books start their chapters over at one in every part, and until now such a file yielded chapters to the end of part one and then stopped — every later announcement heard, understood, and dropped for not continuing the count, which looks exactly like a detection failure. The restart is now recognized once three consecutive chapters of the new part have been heard, and everything from there is marked under the new numbering. Nothing is assumed on weaker evidence: a lone announcement below the sequence is still an in-text mention ("as I said in chapter three") and is still passed over.
Chapters of such a file are titled with their part — "Part 2 - Chapter 1", localized, --part-title to change the word — and each part's numbering is gap-hunted and reported on its own. A book with a single chapter sequence, which is virtually all of them, is written exactly as before.
Run your own command before and after each file
--run-before and --run-after take the command line you would have typed — a shell runs it, so built-ins, pipes, redirection and ~ all work — with placeholders for the parts of a file's path:
abchapterize --recurse --backup \
--run-before "abnormalize $99" \
--run-after "mv $99.bak ~/archive/$1" \
~/audiobooks
$1 is the file name, $0 the same without its extension, $99 the whole path, and $-1, $-2, … the folders above it. Names with spaces, ampersands and brackets are quoted for the shell for you. Neither command runs for a file the run skips, a --run-before that fails skips its file rather than marking a book whose preparation did not happen, and under --dry-run the command line is printed instead of run — which is the quickest way to check your placeholders.
Phrases are now a list, and can say what they are looking for
A phrase option takes alternatives separated by ;, and each one can mark where the chapter number sits with (), ask for a pause in front of it with ^ or behind it with $, and be restricted to one language with [sv]. So
--chapter-phrase "[sv]/^() kapit(?:el|let)/"
says what a Swedish chapter announcement actually sounds like — the number first, a real pause before it — instead of hoping a bare word match lands in the right place. The built-in phrases for all eleven languages are written the same way, and a mark's position is now confirmed against the one alternative that found it rather than against the whole phrase.
A dull recording gets a second chance at a garbled announcement
On some recordings the recognizer writes a chapter's number but loses the word beside it — "1. The Long Road" where the narrator said "Chapter one, The Long Road" — and the chapter is then missed with nothing in the output to show a heading was heard at all. Such a window is now read once more through a built-in speech denoiser. It never moves a mark that was already found, and does not run at all on a book whose audio is clear enough not to need it, so most files never reach it. --no-denoise switches it off.
Also new
--max-chapter-numbernow defaults to 200, counted from wherever the numbering starts. A year or a page number misheard as a chapter can no longer declare two thousand chapters missing and send the run hunting through the whole book for them.--named-mark-distancefolds a prologue, epilogue or--custommark landing within a few seconds of a chapter into that chapter's own entry — "Chapter 10 (Interlude)" — instead of leaving two marks a few seconds apart for a listener to choose between.--custommappings can say what kind of thing they name: where in the book it may appear, whether more than one is expected, and whether it has to follow a pause.- The epilogue now has to follow the book's last chapter. A match between two chapters is the word turning up in prose, and the mark would be wrong;
--customis there for a section that really does belong in the middle. - A detected prologue is taken as saying this file holds the book's beginning, so anything missing below the first chapter found is searched for rather than assumed absent.
- Everything the tool prints now calls a chapter entry a mark, and a file's result line groups what it wrote.
Before you upgrade a script
--max-jingle-length / -X is gone: how far a book's music reaches is measured from the book's own jingles now, which is tighter than the old 45-second assumption on nearly every book and no longer something to get wrong from the command line. A script still passing it gets an error saying so rather than a silent "unknown option".
Three details of the phrase and title options changed meaning, all of them visible the moment they matter: ; always separates alternatives now (write \; for one that belongs to a regexp), an untagged alternative applies to every language rather than only the ones no tag names, and a title referencing a capturing group by number ($1) is refused with an error naming the fix — name the group instead.
And a good number of bugs were cornered and exterminated. The CHANGELOG names them individually, as is only proper.
Downloads
| File | Platform |
|---|---|
abchapterize-0.12.0-win-x64.zip |
Windows x64 |
abchapterize-0.12.0-linux-x64.tar.gz |
Linux x64 (glibc) |
Self-contained — no .NET runtime to install. Each archive carries the executable, the native Whisper and ONNX Runtime libraries (CPU, CUDA and Vulkan backends), the README, the manual and all license texts. Unpack anywhere and keep the runtimes folder next to the executable; you still need ffmpeg/ffprobe available, and the speech model downloads itself on first run.