# Diff, Match and Patch

## Demo of Patch

Two texts can be diffed against each other, generating a list of patches. These patches can then be applied against a third text. If the third text has edits of its own, this version of patch will apply its changes on a best-effort basis, reporting which patches succeeded and which failed.

In this scenario Shakespeare wrote Hamlet in old English, the source document. Then two derivative works were created. One is Hamlet updated to modern English. The other is a Star Trek parody in old English. This demonstrantion creates a list of patches between the source and the modern English version. Then it applies those patches onto the Star Trek parody, thus creating a Star Trek parody in modern English.

### Shakespeare's copy:

Old Version:
Hamlet: Do you see yonder cloud that's almost in shape of a camel? Polonius: By the mass, and 'tis like a camel, indeed. Hamlet: Methinks it is like a weasel. Polonius: It is backed like a weasel. Hamlet: Or like a whale? Polonius: Very like a whale. -- Shakespeare

New Version:
Hamlet: Do you see the cloud over there that's almost the shape of a camel? Polonius: By golly, it is like a camel, indeed. Hamlet: I think it looks like a weasel. Polonius: It is shaped like a weasel. Hamlet: Or like a whale? Polonius: It's totally like a whale. -- Shakespeare

### Trekkie's copy:

Old Version: Kirk: Do you see yonder cloud that's almost in shape of a Klingon? Spock: By the mass, and 'tis like a Klingon, indeed. Kirk: Methinks it is like a Vulcan. Spock: It is backed like a Vulcan. Kirk: Or like a Romulan? Spock: Very like a Romulan. -- Trekkie | New Version:

Back to Diff, Match and Patch