{"id":34839,"date":"2022-05-20T15:16:18","date_gmt":"2022-05-20T14:16:18","guid":{"rendered":"https:\/\/www.roger-pearse.com\/weblog\/?p=34839"},"modified":"2022-05-20T15:16:18","modified_gmt":"2022-05-20T14:16:18","slug":"a-way-to-compare-two-early-modern-editions-of-a-latin-text","status":"publish","type":"post","link":"https:\/\/roger-pearse.com\/weblog\/2022\/05\/20\/a-way-to-compare-two-early-modern-editions-of-a-latin-text\/","title":{"rendered":"A way to compare two early-modern editions of a Latin text"},"content":{"rendered":"<p align=\"justify\">There are three early modern editions of John the Deacon&#8217;s\u00a0<em>Life of St Nicholas<\/em>.\u00a0 These are the Mombritius (1498), Falconius (1751) and Mai (1830-ish) editions.\u00a0 I have already used Abbyy Finereader 15 to create a word document for each containing the electronic text.<\/p>\n<p align=\"justify\">But how to compare these?\u00a0 I took a look at Juxta but did not like it, and this anyway is ceasing to be available.\u00a0 For Collatex I have only been able to use the online version, and I find the output tiring.\u00a0 But Collatex does allow you to compare more than two witnesses.<\/p>\n<p align=\"justify\">The basic problem is that most comparison tools operate on a line-by-line basis.\u00a0 But in a printed edition the line-breaks are arbitrary.\u00a0 We just don&#8217;t care about them.\u00a0 I have not found a way to get the Unix\u00a0<span style=\"text-decoration: underline;\"><em>diff<\/em><\/span> utility to ignore line breaks.<\/p>\n<p align=\"justify\">Today I discovered the existence of\u00a0<span style=\"text-decoration: underline;\"><em>dwdiff<\/em><\/span>, available <a href=\"https:\/\/os.ghalkes.nl\/dwdiff.html\">here<\/a>.\u00a0 This can do this quite effectively, as <a href=\"https:\/\/www.linux.com\/news\/cli-magic-see-changes-word-word-dwdiff\/\">this article makes clear<\/a>.\u00a0 The downside is that dwdiff is not available for Windows; only for MacOS X, and for Ubuntu Linux.<\/p>\n<p align=\"justify\">Fortunately I installed the Windows Subsystem for Linux (WSL) on my Windows 10 PC some time back, with Ubuntu as the Linux variant.\u00a0 \u00a0 So all I had to do was hit the Start key, and type Ubuntu, then click the App that appeared.\u00a0 Lo and behold, a Linux Bash-shell command line box appeared.<\/p>\n<p align=\"justify\">First, I needed to update Ubuntu; and then install dwdiff.\u00a0 Finally I ran the man command for dwdiff, to check the installation had worked:<\/p>\n<pre>sudo apt-get update \u2013y\nsudo apt-get install -y dwdiff\nman dwdiff<\/pre>\n<p align=\"justify\">I then tested it out.\u00a0 I created the text files in the <a href=\"https:\/\/www.linux.com\/news\/cli-magic-see-changes-word-word-dwdiff\/\">article linked earlier<\/a>.\u00a0 Then I needed to copy them into the WSL area.\u00a0 Because I have never really used the WSL, I was a bit unsure how to find the &#8220;home&#8221; directory.\u00a0 But at the Bash shell, you just type this to get Windows Explorer, and then you can copy files using Windows drag and drop:<\/p>\n<pre>explorer.exe .<\/pre>\n<p align=\"justify\">The space and dot are essential.\u00a0 This opened an explorer window on &#8220;\\\\wsl$\\Ubuntu-20.04\\home\\roger&#8221; (??), and I could get on.\u00a0 I ran the command:<\/p>\n<pre>dwdiff draft1.txt draft2.txt<\/pre>\n<p align=\"justify\">And got the output, which was a bit of tech gobbledegook:<\/p>\n<pre><strong>[-To start with, you-]{+You+}<\/strong> may need to install Tomboy, since it's not yet part of the\nstable GNOME release. Most recent distros should have Tomboy packages\navailable, though they may not be installed by default. On Ubuntu,\nrun apt-get install tomboy, which should pull down all the necessary <strong>[-dependencies ---]<\/strong>\n<strong>{+dependencies,+}<\/strong> including Mono, if you don't have it installed already.<\/pre>\n<p align=\"justify\">The [-&#8230;] stuff is the value in the first file; the {+&#8230;} is the different text in the second file.\u00a0 Other text is common.<\/p>\n<p align=\"justify\">There were also some useful options:<\/p>\n<ul>\n<li><em>dwdiff -c draft1.txt draft2.txt<\/em> added colours to the output.<\/li>\n<li><em>dwdiff &#8211;ignore-case file1 file2<\/em> made it treat both files as lower case.<\/li>\n<li><em>dwdiff &#8211;no-common file1 file2<\/em> caused it to omit the common text.<\/li>\n<\/ul>\n<p align=\"justify\">So I thought I&#8217;d have a go.<\/p>\n<p align=\"justify\">First I went into word and saved each file as a <strong><span style=\"text-decoration: underline;\">.txt<\/span><\/strong> file.\u00a0 I didn&#8217;t fiddle with any options.\u00a0 This gave me a mombritius.txt, a falconius.txt and a mai.txt.<\/p>\n<p align=\"justify\">I copied these to the WSL &#8220;home&#8221;, and I ran dwdiff on the two of them like this:<\/p>\n<pre>dwdiff falconius.txt mombritius.txt --no-common -i &gt; op.txt<\/pre>\n<p align=\"justify\">The files are fairly big, so the output was piped to a new file, op.txt.\u00a0 This I opened, in Windows, using the free programmer tool, <a href=\"https:\/\/notepad-plus-plus.org\/downloads\/\"><strong>Notepad++<\/strong><\/a>.<\/p>\n<p align=\"justify\">The results were interesting, but I found that there were too many useless matches.\u00a0 A lot of these were punctuation.\u00a0 In other cases it was as simple as &#8220;cujus&#8221; versus &#8220;cuius&#8221;.<\/p>\n<p align=\"justify\">So I opened my falconius.txt in Notepad++ and using Ctrl-H globally replaced the punctuation by a space: the full-stop (.), the colon (:), semi-colon(;), question-mark (?), and two different sorts of brackets &#8211; () and [].\u00a0 Then I saved.<\/p>\n<p align=\"justify\">I also changed all the text to lower case (Edit | Convert Case to| lower).<\/p>\n<p align=\"justify\">I then changed all the &#8220;v&#8221; to a &#8220;u&#8221; and all the &#8220;j&#8221; to an &#8220;i&#8221;.<\/p>\n<p align=\"justify\">And then, most importantly, I saved the file!\u00a0 I did the same with the Mombritius.txt file.<\/p>\n<p align=\"justify\">Then I ran the command again, and piped the results to a text file.\u00a0 (I found that if I included the common text, it was far easier to work with.)<\/p>\n<pre>dwdiff falconius.txt mombritius.txt &gt; myop2.txt<\/pre>\n<p align=\"justify\">Then I opened myop2.txt in Notepad++.<\/p>\n<p align=\"justify\">This produced excellent results.\u00a0 The only problem was that the result, in myop2.txt, was on very long lines.\u00a0 But this could easily be fixed in Notepad++ with <em>View | Word Wrap<\/em>.<\/p>\n<p align=\"justify\">The result looked as follows:<\/p>\n<figure id=\"attachment_34840\" aria-describedby=\"caption-attachment-34840\" style=\"width: 1881px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/roger-pearse.com\/weblog\/wp-content\/uploads\/2022\/05\/npp_word_wrap.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-34840\" src=\"https:\/\/roger-pearse.com\/weblog\/wp-content\/uploads\/2022\/05\/npp_word_wrap.jpg\" alt=\"Output from dwdiff\" width=\"1881\" height=\"877\" \/><\/a><figcaption id=\"caption-attachment-34840\" class=\"wp-caption-text\">Falconius edition vs Mombritius edition<\/figcaption><\/figure>\n<p align=\"justify\">The &#8220;-[]&#8221; stuff was Falconius only, the &#8220;+{}&#8221; was Mombritius.\u00a0 (I have no idea why chapter 2 is indented).<\/p>\n<p align=\"justify\">That, I think, is rather useful.\u00a0 It&#8217;s not desperately easy to read &#8211; it really needs a GUI interface, that colours the two kinds of text.\u00a0 But that would be fairly easy to knock up in Visual Basic, I think.\u00a0 I might try doing that.<\/p>\n<p align=\"justify\">Something not visible in the screen shot was in chapter 13, where the text really gets different.\u00a0 Also not visible in the screen grab &#8211; but very visible in the file &#8211; is the end, where there is a long chunk of additional (but spurious) text at the end of the Mombritius.<\/p>\n<p align=\"justify\">Here by the way is the &#8220;no-common&#8221; output from the same exercise (with my note on lines 1-2)<\/p>\n<p align=\"justify\"><a href=\"https:\/\/roger-pearse.com\/weblog\/wp-content\/uploads\/2022\/05\/npp_no_common_dwdiff.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-34841\" src=\"https:\/\/roger-pearse.com\/weblog\/wp-content\/uploads\/2022\/05\/npp_no_common_dwdiff.jpg\" alt=\"dwdiff no-common output\" width=\"826\" height=\"883\" \/><\/a><\/p>\n<p align=\"justify\">This is quite useful as far as it goes.\u00a0 There are some things about this which are less than ideal:<\/p>\n<ul>\n<li>Using Linux.\u00a0 Nobody but geeks has Linux.<\/li>\n<li>Using an oddball command like\u00a0<em>dwdiff<\/em>, instead of a standard utility.\u00a0 What happens if this ceases to be supported?<\/li>\n<li>The output does not display the input.\u00a0 Rather it displays the text, all lower case, no &#8220;j&#8221; and &#8220;v&#8221;, no punctuation.\u00a0 This makes it harder to relate to the original text.<\/li>\n<li>It&#8217;s all very techy stuff.\u00a0 No normal person uses command-line tools and Notepad++.<\/li>\n<li>The output is still hard to read &#8211; a GUI is needed.<\/li>\n<li>Because it relies on both Linux and Windows tools, it&#8217;s rather ugly.<\/li>\n<\/ul>\n<p>Surely a windows tool with a GUI that does it all could be produced?<\/p>\n<p>The source code for dwdiff is available, but my urge to attempt to port a linux C++ command line utility to windows is zero.\u00a0 If there was a Windows version, that would help a lot.<\/p>\n<p>Maybe this afternoon I will have a play with Visual Basic and see if I can get that output file to display in colour?<\/p>\n<p align=\"justify\">\n","protected":false},"excerpt":{"rendered":"<p>There are three early modern editions of John the Deacon&#8217;s\u00a0Life of St Nicholas.\u00a0 These are the Mombritius (1498), Falconius (1751) and Mai (1830-ish) editions.\u00a0<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_awef_post_faq_schema":[],"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[19],"tags":[448,471,1075],"class_list":["post-34839","post","type-post","status-publish","format-standard","hentry","category-from-my-diary-announcements","tag-collation","tag-computing","tag-manuscripts"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/posts\/34839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/comments?post=34839"}],"version-history":[{"count":0,"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/posts\/34839\/revisions"}],"wp:attachment":[{"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/media?parent=34839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/categories?post=34839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roger-pearse.com\/weblog\/wp-json\/wp\/v2\/tags?post=34839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}