Fix chord alignment: snap to word boundaries

Improve merge_chord_lyric() to snap chord positions to the start
of the word they fall within, instead of splitting words mid-way.
Fixes artifacts like "Liebespaar \chord{C}e" → "\chord{C}Liebespaare".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-04-02 16:36:06 +02:00
parent d875fd225b
commit 7b99778f67
295 changed files with 1804 additions and 1782 deletions

View File

@@ -9,16 +9,16 @@
}
\begin{verse}
Whats r \chord{e}ight and what is wrong by the l \chord{G}aw, by the l \chord{D}aw? \\
Whats r \chord{e}ight and what is wrong \chord{D}by the l \chord{e}aw? \\
\chord{D}Whats \chord{G}right and what is wrong by s \chord{D}hort or by long? \\
A we \chord{e}ak arm or a strong f \chord{D}or to d \chord{e}raw, for to d \chord{D}raw? \\
A we \chord{e}ak arm or a strong f \chord{D}or to d \chord{e}raw. \\
Ye J \chord{e}acobites by name lend an e \chord{G}ar, lend an \chord{D}ear. \\
Ye \chord{e}Jacobites by name l \chord{D}end an e \chord{e}ar. \\
\chord{D}Ye \chord{G} Jacobites by name, your f \chord{D}aults I will proclaim, \\
Your d \chord{e}octrines I must blame you shall h \chord{G}ear, you shall h \chord{D}ear. \\
Your d \chord{e}octrines I must blame y \chord{D}ou shall h \chord{e}ear.
Whats \chord{e}right and what is wrong by the \chord{G}law, by the \chord{D}law? \\
Whats \chord{e}right and what is wrong \chord{D}by the \chord{e}law? \\
\chord{D}Whats \chord{G}right and what is wrong by \chord{D}short or by long? \\
A \chord{e}weak arm or a strong \chord{D}for to \chord{e}draw, for to \chord{D}draw? \\
A \chord{e}weak arm or a strong \chord{D}for to \chord{e}draw. \\
Ye \chord{e}Jacobites by name lend an \chord{G}ear, lend an \chord{D}ear. \\
Ye \chord{e}Jacobites by name \chord{D}lend an \chord{e}ear. \\
\chord{D}Ye \chord{G}Jacobites by name, your \chord{D}faults I will proclaim, \\
Your \chord{e}doctrines I must blame you shall \chord{G}hear, you shall \chord{D}hear. \\
Your \chord{e}doctrines I must blame \chord{D}you shall \chord{e}hear.
\end{verse}
\begin{verse}