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

@@ -5,12 +5,12 @@
}
\begin{verse}
In Du \chord{C}blin's fair c \chord{a}ity, \\
where gir \chord{d}ls are so pret \chord{G7}ty, \\
I \chord{C}first set my e \chord{A7}yes on sweet \chord{D7}Molly Malo \chord{G7}ne, \\
as she whe \chord{C}eled her wheelbarr \chord{a}ow \\
through stre \chord{d}ets broad and na \chord{G7}rrow, \\
crying, "Co \chord{C}ckles and musse \chord{a}ls, ali \chord{d}v \chord{C}e, ali \chord{G7}ve \chord{C}oh!”
In \chord{C}Dublin's fair \chord{a}city, \\
where \chord{d}girls are so \chord{G7}pretty, \\
I \chord{C}first set my \chord{A7}eyes on sweet \chord{D7}Molly \chord{G7}Malone, \\
as she \chord{C}wheeled her \chord{a}wheelbarrow \\
through \chord{d}streets broad and \chord{G7}narrow, \\
crying, \chord{C}"Cockles and \chord{a}mussels, \chord{C}alive, \chord{G7}alive \chord{C}oh!”
\end{verse}
\begin{verse}
@@ -18,8 +18,8 @@ Ref.:
\end{verse}
\begin{verse}
\chord{G}Al \chord{C}ive, alive \chord{a}oh! Al \chord{d}ive, alive \chord{G7}oh! \\
Crying, "C \chord{C}ockles and muss \chord{a}els, aliv \chord{d}e, \chord{C} ali \chord{G7}ve \chord{C}oh"!
\chord{C}Alive, alive \chord{a}oh! \chord{d}Alive, alive \chord{G7}oh! \\
Crying, \chord{C}"Cockles and \chord{a}mussels, \chord{d}alive, \chord{G7}alive \chord{C}oh"!
\end{verse}
\begin{verse}