{"id":1109,"date":"2019-04-30T12:38:54","date_gmt":"2019-04-30T16:38:54","guid":{"rendered":"https:\/\/wwp.northeastern.edu\/blog\/?p=1109"},"modified":"2019-04-30T12:38:54","modified_gmt":"2019-04-30T16:38:54","slug":"markup-revision","status":"publish","type":"post","link":"https:\/\/wwp.northeastern.edu\/blog\/markup-revision\/","title":{"rendered":"Breaking Down Markup Revision Projects: An Approach for Adding Line Breaks to Encoded Documents"},"content":{"rendered":"<p><i><span style=\"font-weight: 400;\">In this blog post, we describe the WWP&#8217;s solution to a problem that other projects may well face: inserting encoding for line breaks after a text has been transcribed. Here is a lightly edited transcript of an interview Kyle Wholey (Outreach Coordinator at the WWP) conducted with Syd Bauman (Senior XML Programmer-Analyst) and Sarah Connell (<\/span><\/i><i><span style=\"font-weight: 400;\">Assistant Director). \u00a0<\/span><\/i><\/p>\n<p><b>So what exactly was the problem you worked on here? <\/b><\/p>\n<p><b>Sarah:<\/b><span style=\"font-weight: 400;\"> We recently discovered an issue with a text that had been started by one of our encoders several years ago. This encoder had transcribed the first 90 pages of a novel, but forgot to include all of the line beginning (&lt;lb&gt;) elements, which are important for our proofreading practices and for accurately encoding phenomena such as words that break over lines. To fix this problem, Syd and I worked together, since it would be an extremely time-consuming task for one person to take on. I read the text aloud (indicating where the line beginnings needed to be) while Syd used a program he wrote to add in the missing &lt;lb&gt; elements. <\/span><\/p>\n<p><b>Can you describe your approach a bit more? <\/b><\/p>\n<p><b>Syd: <\/b><span style=\"font-weight: 400;\">What we did was pretty consistent with our general approach to solving problems. We automated everything as much as possible. One of our main goals was to try and minimize the amount of time spent by a person rereading the document. <\/span><\/p>\n<p><b>Sarah:<\/b><span style=\"font-weight: 400;\"> With certain kinds of issues, it\u2019s quicker and easier to fix minor errors automatically; for example, if someone consistently uses the wrong element, we can use a simple find-and-replace to change all instances to the correct element. But in this case, there was no way to resolve this issue without consulting the original text to see where we needed to insert the missing &lt;lb&gt; elements. So, we took an approach that would let us automate things as much as possible, using a bit of teamwork and a single-purpose program.<\/span><\/p>\n<p><b>Syd:<\/b><span style=\"font-weight: 400;\"> It was important that the command to insert the &lt;lb&gt; element and move the cursor forward had to be only one keystroke (it\u2019s significantly less time consuming this way). In this case I used a slash for inserting the encoding for just a missing &lt;lb&gt; element, or a hyphen for inserting the encoding for cases where a word broke over the line. <\/span><\/p>\n<p><b>So what is this shortcut? How did you develop a quicker way of going through this document? <\/b><\/p>\n<p><b>Syd: <\/b><span style=\"font-weight: 400;\">Luckily, a large portion of the text did already have line breaks encoded. I did some initial XSLT-based analysis to calculate that number of words per line in the part of the text that already had line breaks encoded, and found an average of 8 to 9 words, something like every 8.45 words if you want to get precise. So I developed an Emacs Lisp program that would insert the missing &lt;lb&gt; tag and a new line and then move the cursor forward 8 words automatically. For words that break over lines, I set up a version that inserts not only the &lt;lb&gt; but also the end-of-line-hyphen (or &#8220;soft hyphen&#8221;) that marks the break in the word. One of the advantages of using Emacs here is that any program can be bound to any key. So I bound the former program to \u2018\/\u2019 and the latter to \u2018-\u2019. So in one keystroke the right thing got entered, and \u201cpop\u201d, my cursor was at or pretty close to where it needed to be for the next one. \u00a0<\/span><\/p>\n<p><b>Sarah: <\/b><span style=\"font-weight: 400;\">After that, Syd and I sat down together to work on this. I would read out the first word in each new line from the text (or read out where the new line began in the middle of a word) and he moved the cursor where it needed to be and hit the right key to insert the missing encoding and keep moving forward. <\/span><\/p>\n<p><b>Syd: <\/b><span style=\"font-weight: 400;\">And, generally speaking, I only had to move the cursor back or forward one word [before inserting the next &lt;lb&gt; each time] throughout the entire text. Our estimate, that a line break occurred every 8\u20139 words, really made this process easier and quicker to correct. <\/span><\/p>\n<p><b>How exactly does this relate to your proofreading processes? <\/b><\/p>\n<p><b>Sarah:<\/b><span style=\"font-weight: 400;\"> WWO\u2019s interface doesn\u2019t show line breaks, but we transcribe them because it makes proofreading so much easier. Our proofreading process involves having an encoder read line by line, checking the transcription against our copy of the original text. So, without these &lt;lb&gt;s, it would be extremely difficult to locate where you are in the text to make sure that you&#8217;re proofing each line properly. <\/span><\/p>\n<p><b>I\u2019ve heard you talk about soft hyphen encoding a few times. Could you explain that a bit more? <\/b><\/p>\n<p><b>Syd: <\/b><span style=\"font-weight: 400;\">We use this encoding for words that break over lines. Soft hyphens are particularly common in prose paragraphs, where the typesetter will often break words over the line to fit as much text on the page as possible. At the WWP, we encode these by using a Unicode character [U+00AD, see <\/span><a href=\"https:\/\/wwp.northeastern.edu\/research\/publications\/documentation\/internal\/#!\/entry\/hyphenation_narrative\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\"> for more details]. But sometimes this encoding can create more complications. I\u2019ve written about this problem in an article: \u00a0\u201c<\/span><a href=\"https:\/\/www.balisage.net\/Proceedings\/vol17\/html\/Bauman01\/BalisageVol17-Bauman01.html\"><span style=\"font-weight: 400;\">The Hard Edges of Soft Hyphens<\/span><\/a><span style=\"font-weight: 400;\">.\u201d <\/span><\/p>\n<p><b>What was the final outcome of this process? Was it a success? <\/b><\/p>\n<p><b>Sarah: <\/b><span style=\"font-weight: 400;\">It was a long process, we had four sessions to get through it all, but we accomplished a lot. Syd can tell you a bit more about the specifics. <\/span><\/p>\n<p><b>Syd: <\/b><span style=\"font-weight: 400;\">Yes, here\u2019s a list of our accomplishments. At the end of our sessions we: inserted 3,140 &lt;lb&gt;s, added 482 soft hyphens, added ~152 additional words that had been missing, and fixed 28 typos. <\/span><\/p>\n<p><b>Wow that\u2019s impressive! So what\u2019s the takeaway from all this? <\/b><\/p>\n<p><b>Syd:<\/b><span style=\"font-weight: 400;\"> I would say that the take-home lesson is this: it\u2019s often the case that you cannot write programs to do this kind of work, but you can write programs that make it easier for humans to do the work. And that can still be very powerful. <\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Screenshots of the code can be found <a href=\"http:\/\/paramedic.wwp.northeastern.edu\/~syd\/temp\/wwp\/wwp-insert-lb-then-jump-forward-8-words_screenshot_01.png\">here<\/a>\u00a0and <a href=\"http:\/\/paramedic.wwp.northeastern.edu\/~syd\/temp\/wwp\/wwp-insert-lb-then-jump-forward-8-words_screenshot_02.png\">here<\/a>. See a GitHub repository with the full code for download\u00a0<a href=\"https:\/\/github.com\/NEU-DSG\/wwp-public-code-share\/tree\/master\/miscellaneous\/rapid_insertion\">here<\/a>.\u00a0<\/span><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, we describe the WWP&#8217;s solution to a problem that other projects may well face: inserting encoding for line breaks after a text has been transcribed. Here is a lightly edited transcript of an interview Kyle Wholey (Outreach Coordinator at the WWP) conducted with Syd Bauman (Senior XML Programmer-Analyst) and Sarah Connell (Assistant Director). \u00a0 So what exactly was the problem you worked on here? Sarah: We recently discovered an issue with a text that had been&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/wwp.northeastern.edu\/blog\/markup-revision\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1109","post","type-post","status-publish","format-standard","hentry","category-encoding-explorations"],"_links":{"self":[{"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/posts\/1109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/comments?post=1109"}],"version-history":[{"count":5,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/posts\/1109\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/posts\/1109\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/media?parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/categories?post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wwp.northeastern.edu\/blog\/wp-json\/wp\/v2\/tags?post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}