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

@@ -12,12 +12,12 @@
\chord{e}What shall we do with the drunken sailor? \\
\chord{D}What shall we do with the drunken sailor? \\
\chord{e}What shall we do with the drunken sailor, \\
\chord{e}e \chord{D}arly in the m \chord{e}orning?
\chord{D}early in the \chord{e}morning?
\end{verse}
\begin{verse}
Ref.: H \chord{e}ooray, and up she rises. H \chord{D}ooray, and up she \\
rises. H \chord{e}ooray, and up she rises, e \chord{e}a \chord{D}rly in the m \chord{e}orning.
Ref.: \chord{e}Hooray, and up she rises. \chord{D}Hooray, and up she \\
rises. \chord{e}Hooray, and up she rises, \chord{D}early in the \chord{e}morning.
\end{verse}
\begin{verse}