<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.12-alpha" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Diff for Javascript</title>
	<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript</link>
	<description>What happens at LShift</description>
	<pubDate>Sun, 06 Jul 2008 01:49:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.12-alpha</generator>

	<item>
		<title>by: tonyg</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-85594</link>
		<pubDate>Wed, 20 Feb 2008 19:23:57 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-85594</guid>
					<description>&lt;p&gt;You're right, Peter - computing a diff character-by-character seems to give spurious diffs! How odd. Have you dug into the code to find out why that might be?&lt;/p&gt;

&lt;p&gt;Splitting the string into words first gives a sensible answer:&lt;/p&gt;

&lt;p&gt;js&gt; uneval(diff(str1.split(/\s+/), str2.split(/\s+/)));&lt;/p&gt;

&lt;p&gt;[{common:["The"]},
 {file1:["red"], file2:[]},
 {common:["brown"]},
 {file1:[], file2:["spotted"]},
 {common:["fox"]},
 {file1:["jumped"], file2:["leaped"]},
 {common:["over", "the", "rolling"]},
 {file1:["log."], file2:["log"]}]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, Peter - computing a diff character-by-character seems to give spurious diffs! How odd. Have you dug into the code to find out why that might be?</p>
<p>Splitting the string into words first gives a sensible answer:</p>
<p>js> uneval(diff(str1.split(/\s+/), str2.split(/\s+/)));</p>
<p>[{common:[&#8221;The&#8221;]},<br />
 {file1:[&#8221;red&#8221;], file2:[]},<br />
 {common:[&#8221;brown&#8221;]},<br />
 {file1:[], file2:[&#8221;spotted&#8221;]},<br />
 {common:[&#8221;fox&#8221;]},<br />
 {file1:[&#8221;jumped&#8221;], file2:[&#8221;leaped&#8221;]},<br />
 {common:[&#8221;over&#8221;, &#8220;the&#8221;, &#8220;rolling&#8221;]},<br />
 {file1:[&#8221;log.&#8221;], file2:[&#8221;log&#8221;]}]</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Peter Pallos</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-85420</link>
		<pubDate>Tue, 19 Feb 2008 22:14:55 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-85420</guid>
					<description>&lt;p&gt;The code fails with the two sentences that I found on a different site:&lt;/p&gt;

&lt;p&gt;str1 = "The red brown fox jumped over the rolling log.";
str2 = "The brown spotted fox leaped over the rolling log";
alert(uneval(diff(str1, str2)));&lt;/p&gt;

&lt;p&gt;For example, a part of the result array is:
{common:["o", "v"]}, {file1:["e"], file2:["e"]}, {common:["r"]}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The code fails with the two sentences that I found on a different site:</p>
<p>str1 = &#8220;The red brown fox jumped over the rolling log.&#8221;;<br />
str2 = &#8220;The brown spotted fox leaped over the rolling log&#8221;;<br />
alert(uneval(diff(str1, str2)));</p>
<p>For example, a part of the result array is:<br />
{common:[&#8221;o&#8221;, &#8220;v&#8221;]}, {file1:[&#8221;e&#8221;], file2:[&#8221;e&#8221;]}, {common:[&#8221;r&#8221;]}</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: frank</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57695</link>
		<pubDate>Tue, 22 May 2007 16:01:39 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57695</guid>
					<description>&lt;p&gt;OK , perhaps i'll try to do a new one by myself . thanx&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>OK , perhaps i&#8217;ll try to do a new one by myself . thanx</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: tonyg</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57626</link>
		<pubDate>Tue, 22 May 2007 12:15:04 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57626</guid>
					<description>&lt;p&gt;Hi Frank, unfortunately I've not yet returned to this little project. I'll be sure to post when I do, though.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Frank, unfortunately I&#8217;ve not yet returned to this little project. I&#8217;ll be sure to post when I do, though.</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: frank</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57485</link>
		<pubDate>Tue, 22 May 2007 03:48:06 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-57485</guid>
					<description>&lt;p&gt;How is your diff3 going on ?
If it finish , may I see it's source code by JS .&lt;/p&gt;

&lt;p&gt;Thanks alot&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>How is your diff3 going on ?<br />
If it finish , may I see it&#8217;s source code by JS .</p>
<p>Thanks alot</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: mikeb</title>
		<link>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-8830</link>
		<pubDate>Sun, 27 Aug 2006 07:48:16 +0000</pubDate>
		<guid>http://www.lshift.net/blog/2006/08/15/diff-for-javascript#comment-8830</guid>
					<description>&lt;p&gt;Also see http://neil.fraser.name/software/diff_match_patch/&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Also see http://neil.fraser.name/software/diff_match_patch/</p>
]]></content:encoded>
				</item>
</channel>
</rss>
