Skip to content

Conversation

@julowe
Copy link

@julowe julowe commented Jan 16, 2026

This PR addresses the 'False/Extra Line Number at Chapter Start' part of issue #2851

It also fixes some smaller scope problems that I saw as I checked over the text.

There are still some questions and issues from mentioned issue to discuss/address, which could be done in this PR, so I've created this as a Draft for now.

julowe added 15 commits January 15, 2026 17:21
used `%s/\(subtype="chapter" n="\d\{1,2\}">\)\n\s*<lb n="\d\{1,2\}"\/>$/\1\2/gc`
used `%s/\(subtype="chapter" n="\d\{1,2\}">\n\)\(.*\) <lb n="\d\{1,2\}"\/>/\1\2/gc`
and was careful not to remove true `lb` tags (different number value than chapter number)
[only 266a10 appeared to be a false `lb` but was actually a true one]
some `lb` tags and some marginal notes had multiple values.
seperated them so only one value was in each tag,
and then placed them at correct line starts according to:
https://archive.org/details/aristotelisopera01arisrich
edge case: the margin note on the inside edge of the text marking chapter 10 was converted to a line number,
and the actual 10 marking the line number on the outside of the text was ignored.
`lb` thus was correct number but on wrong end of the line.
ran:
`perl -i.bak -pe 's/<pb n="(\d+)"\/>/ $pb_num=$1; ($pb_num > 52 && $pb_num < 77) ? "<pb n=\"" . ($pb_num+1) . "\"\/>" : $& /ge' tlg0086.tlg031.1st1K-grc1.xml`
then edited the second `pb` 52 to 53
ran:
`perl -i.bak -pe 's/<pb n="(\d+)"\/>/ $pb_num=$1; ($pb_num > 94) ? "<pb n=\"" . ($pb_num-1) . "\"\/>" : $& /ge' tlg0086.tlg031.1st1K-grc1.xml`

ref `pb` 95 was corrected to `pb` 94, now it is correctly 8 off of SLUB page number,
ref: http://digital.slub-dresden.de/id416133894/102
the first `lb` 33 was placed one line early, corrected to placement in source text.
a word was split with a dot and then that `lb` tag, I combined the word.
Added missing ) after that split word.
this is on `pb` 60, so ref:
http://digital.slub-dresden.de/id416133894/68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant