AmVerse Tip #1: Broken Lines

Dan and Kirk between them arrived at the following methods for dealing with at least some of the "broken" lines that have been plaguing some books, lines that are printed as two lines in the book, usually with the second one indented, because there was no room to print them as one line.

Such broken lines should of course be rejoined when tagging, like this:

<L>Mary had a little lamb.</L>
<L>Its fleece was white as snow.</L>

NOT like this:

<L>Mary had a little lamb.</L>
<L>Its fleece was white as</L>
<L REND="ind">snow.</L>

Dan and Kirk used TextPad to fix a lot of these (hundreds of 'em), applying several tests. Test them, if you like, on your books, to make sure that they really can be safely applied. And be aware that even if safe, they won't necessarily catch all the problem lines.

Searching for <L [^>]*>[^ <]+</L> and <L>[^ <]+</L>

(with "regular expression" box checked) finds the verse lines containing only one word. In some poems, these are safely regarded as the ends of broken lines.

Searching for <L [^>]*>[^ <]+ [^ <]+</L> and <L>[^ <]+ [^ <]+</L>

(with "regular expression" box checked) finds the verse lines containing only two words. In some poems, these are safely regarded as the ends of broken lines.

And searching for <L [^>]*>[a-z] and <L>[a-z]

(with "regular expression" and "match case" boxes checked) finds the verse lines that begin with lower-case letters. In some, perhaps most, of our books, these are all broken-line fragments. If the word happens to be a proper noun, or is italicized, or if the line begins with punctuation, among other things, then the search will fail to find it, so this is a good one, but not perfect.

These can be run as replacements, as follows:

  1. Search for: </L>\n?<L[^>]*>\([^ <]+</L>\)

    Replace with: (space)\1 [type in an actual space where I put (space)]

    This recombines broken lines when the second half contains only one word.

  2. Search for: </L>\n?<L[^>]*>\([^ <]+ [^ <]+</L>\)

    Replace with: (space)\1 [type in an actual space where I put (space)]

    This recombines broken lines when the second half contains only two words.

  3. Search for: <\L>\n?<L[^>]*>\([a-z]\)

    Replace with: (space)\1 [type in an actual space where I put (space)]

    This recombines broken lines when the second half begins with a lower-case letter.

Index