<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
  <TITLE>Diff, Match and Patch: Demo of Patch</TITLE>
  <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../javascript/diff_match_patch.js"></SCRIPT>
</HEAD>

<BODY>
<H1>Diff, Match and Patch</H1>
<H2>Demo of Patch</H2>

<P>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.</P>

<P>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.</P>

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
var dmp = new diff_match_patch();

var patch_text = '';

function diff_launch() {
  var text1 = document.getElementById('text1a').value;
  var text2 = document.getElementById('text2a').value;

  var ms_start = (new Date).getTime();
  var diff = dmp.diff_main(text1, text2, true);
  var ms_end = (new Date).getTime();

  if (diff.length > 2) {
    dmp.diff_cleanupSemantic(diff);
  }<commit_msg>Shakespeare wrote Hamlet in Early Modern English.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
  <TITLE>Diff, Match and Patch: Demo of Patch</TITLE>
  <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="../javascript/diff_match_patch.js"></SCRIPT>
</HEAD>

<BODY>
<H1>Diff, Match and Patch</H1>
<H2>Demo of Patch</H2>

<P>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.</P>

<P>In this scenario Shakespeare wrote Hamlet in Early Modern 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 Early Modern 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.</P>

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
var dmp = new diff_match_patch();

var patch_text = '';

function diff_launch() {
  var text1 = document.getElementById('text1a').value;
  var text2 = document.getElementById('text2a').value;

  var ms_start = (new Date).getTime();
  var diff = dmp.diff_main(text1, text2, true);
  var ms_end = (new Date).getTime();

  if (diff.length > 2) {
    dmp.diff_cleanupSemantic(diff);
  }
{'fraction_non_alphanumeric': 0.10652591170825336, 'fraction_numerical': 0.010876519513755598, 'mean_word_length': 4.505281690140845, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2718866', 'n_tokens_mistral': 1011, 'n_tokens_neox': 951, 'n_words': 376}