This page is a demonstration of a simple facility for comparing two texts. Using the drop-down boxes just below here, select the two texts you want to display and compare (Test Snippet A is the text from which all other examples were made, so it's a good choice for the left-hand pane). Then, click the "Compare Texts" button. Differences between the two texts will be shown in bold, colored text. We color any text in one pane which does not appear in the other pane.
For example, if you compare Test Snippet A with Test Snippet B, you'll see four sets of colored text: 1) In the left-hand pane, the characters "a]" are colored red because they do not appear in the right-hand pane; 2) farther down in the left-hand pane, there's a speech by Irenius colored red because it does not apear in the right hand pane; 3) In the right-hand pane, the characters "b]" are colored blue, 4) as is a speech by Steve; the blue colored text is blue because it appears in the right-hand pane, but not the left-hand pane. (To create Test Snippet B, I copied A, changed "a" to "b", deleted Irenius's speech, and added Steve's.)
Comparing A to C shows how spelling differences appear. A to D shows how punctuation differences appear (not so well, as it turns out). A to W shows the deletion of clauses. A to F shows the comparison on totally different texts.
|
|
A list of defects, areas for improvement, etc for this approach:
- When the diff routine tokenizes text, it doesn't separate words from trailing punctuation. For example, in the A-to-B comparision, it thinks "a]" was deleted and "b]" was added, when really the "]" didn't change.
- It would be nice if corresponding parts of the left and right panes were vertically aligned, so that like parts were next to each other.
- The diff routine breaks down in a couple of places. In most cases, the breakdowns aren't a problem; however, it's enough of a problem that we really can't compare A to D.
- A couple of sequences of input don't quite make sense with this interface.