Monday, May 19, 2008

Editable Versions and Groups

At last I can edit groups and versions, delete them, move them between groups or rename them. The Version Edit screen looks a bit crowded (see below) but I reduced the clutter somewhat by using links instead of buttons. Some people think this is poor style. It is far worse to have buttons disguised as links to achieve a similar effect. It is true that the wiki won't function without JavaScript, but it is simply impossible to build this level of functionality without it.

I have also added a Revert button, which restores the text or the versions to the state they were in after the last click on the Save button. The "Edit..." links take you to separate pages which allow you to edit the characteristics of the group or version:

What remains now are a few important features that I hope to set right before we go to Oulu:

  1. Find – I need to reimplement the same search facility we had in the desktop version of the tool. It should be easy because the highlighting of search hits is similar to the highlighting of differences between two versions, which we already have. No other application can search multiple versions simultaneously and in linear time – this is one of the great strengths of the MVD format.
  2. Beautify the buttons – these could be reduced to standard icons, and arranged over the top of each text column, instead of at the side. Rather than ugly strings the labels could vanish into 'tool tip text' that only appears when you mouse over them.
  3. Allow the user to author an MVD from scratch. This is meant to be the centrepiece of the demo at Oulo. It is fairly easy, but I will need to automatically markup plain text using TEI encoding and also check the syntax before committing it. That may have to be done in JavaScript again, otherwise we won't be able to alert the user to syntax errors.
  4. Image view and edit image view – this is really cosmetic but could be quite impressive. The only way I can think of getting the correct image to display in HTML as you scroll down is to use hyperlinks in the right hand window that call JavaScript to set the image of the left hand side. At the moment I don't know how to achieve the same effect in edit view.
  5. Synchronise the left and right hand text in Twin View. This can also be done by hyperlinks, as it was in the multilingual example metioned earlier. What it means is that the text on the right corresponds to the text immediately on the left. The user should never have to scroll and read to align the texts manually. This is really important.
  6. Transpositions – I think these can be done as an optimising step after alignment has been completed. Then any significant pairs of deletions/insertions can be tested to see if they qualify as transpositions. I think if we recalculate them after every update there won't be any problems as to which bits are transposed and which bits are insertions/deletions etc. It all boils down to the status of individual fragments: a bit of text is either inserted, deleted, transposed, a match or a variant. When those characteristics change we start a new fragment.
  7. Edit Twin View – I want to use AJAX to automatically update the left hand HTML version of the XML the user is editing on the right.

That's quite a lot of work before I can call Phaidros version 1 complete, but it shouldn't take more than a couple of months at most. Then we will have a completely new tool to play with. It will be exciting to see where we can take multi-version text then.

Sunday, May 4, 2008

Twin View

The idea of viewing two versions of a document side by side and comparing them goes back at least as far as Nelson's 'Parallel Textface' (1971), in which equivalent text fragments, perhaps transposed, were connected by lines. Programmers are also used to comparing versions in this way, but it is not clear to me how the user is supposed to make sense of the interconnecting lines when the unit of comparison is a word rather than a line. Highlighting differences on its own is clearly insufficient, but if combined with synchronisation of the two windows – keeping the text on the left in line with the text on the right – this should be enough to prevent the user losing his or her way. In any case interconnecting lines are impossible in HTML windows, and one of the goals of Phaidros was to display multi-version texts in an ordinary web browser.

Comparing two versions of the Sibylline Gospel (© N. Brocca, 2008)

With this goal in view I have now added Twin View to the wiki, which highlights the differences between two texts. In the Sibylline Gospel example there are 36 versions. The total number of pairs that could be compared is thus (36*35)/2 = 630. Some of the rival programs, such as Juxta and Medite compare texts in real time, cacheing the results in case the same pairs of texts are compared again. But this doesn't work so well when there are more than a handful of versions. An MVD file has the advantage that any combination of versions can be displayed in equal time and the comparison results don't need to be cached. So even if there are 5,600 versions, as in the case of the Greek New Testament, you will always get a quick response.

The version of each window can be changed by choosing the desired version from its popup menu. Text on the left that does not appear in the version on the right is highlighted red, and extra text on the right, not found in the left, is highlighted blue. As yet, transpositions are not detected – they will be shown as insertion/deletion pairs instead. Also, synchronisation has not yet been added, but as in the multilingual example, referenced at the start of this blog, synchronisation in HTML is possible by using hyperlinks to invisibly connect the left hand text with the text on the right. This should be added soon in a later update to the program.