Thanks Raul. Interesting. I'm reminded of the Levenshtein Distance. Normally applied to the comparison of lists of chars (=strings) rather than lists of boxed strings. But I guess the same algorithm can be applied.
I see Roger has an essay on the topic in the wiki, offering a non-looping solution: http://www.jsoftware.com/jwiki/Essays/Levenshtein%20Distance Years ago I fooled around trying to code it in APL, hoping for a better way of matching (personal) names than the clunky old-fashioned Russell-Soundex system which USA police computers used. Never got an elegant solution. On Mon, Nov 21, 2011 at 3:53 PM, Raul Miller <rauldmil...@gmail.com> wrote: > Here's the algorithm for comparing scripts: > > http://www.jsoftware.com/jwiki/Essays/Longest%20Common%20Subsequence > > -- > Raul > > On Mon, Nov 21, 2011 at 10:43 AM, Ian Clark <earthspo...@gmail.com> wrote: > >> That's a neat utility. Pity there's no Mac version -- I don't often >> dust off my old Win2000. >> (For people unable to run it: it shows 2 files side-by-side, padding >> each side to align comparable lines) >> >> I've seen similar displays written in APL. Might be instructive to >> write one in J - if nobody's done it. >> It would be a nice application of /= to boxed strings. >> >> >> On Sun, Nov 20, 2011 at 9:43 PM, Roger Hui <rogerhui.can...@gmail.com> >> wrote: >> > I myself have been using the free software ExamDiff >> > http://www.prestosoft.com/edp_examdiff.asp for about 8 years, ever since >> > the late Alex Rufon recommended it to me. It is used to compare text >> files. >> > >> > >> > >> > On Sun, Nov 20, 2011 at 12:15 PM, Ian Clark <earthspo...@gmail.com> >> wrote: >> > >> >> Thanks Chris. >> >> >> >> I'd discovered Directory Match from a quick search of the J wiki on >> >> "compare" and hurriedly tried it before I posed my question to the >> >> list, but totally missed the significance of the buttons. >> >> >> >> ...Which do what I was looking for. >> >> >> >> On Sun, Nov 20, 2011 at 6:59 PM, chris burke <cbu...@jsoftware.com> >> wrote: >> >> > fcompare is a cover for compare, that compares two files. >> >> > >> >> > Also look at Directory Match, available in the gui. This uses compare >> >> under >> >> > the covers, and has a button to call an external diff like meld for >> more >> >> > control. >> >> > >> >> > On Mon, Nov 21, 2011 at 12:09 AM, Ian Clark <earthspo...@gmail.com> >> >> wrote: >> >> > >> >> >> Thanks, David. Just what I need. >> >> >> >> >> >> I'll have to get to know my addons a lot better. >> >> >> >> >> >> >> >> >> >> >> >> On Sun, Nov 20, 2011 at 2:11 PM, David Mitchell < >> davidmitch...@att.net> >> >> >> wrote: >> >> >> > I have used these 2 methods on Windows and J6. >> >> >> > >> >> >> > 0: >> >> >> > Assume f1 and f2 contain the full file path to two J scripts. >> >> >> > >> >> >> > 1: >> >> >> > >> >> >> > load'compare' >> >> >> > load'files' >> >> >> > (fread fn1) compare_jcompare_ (fread fn2) >> >> >> > >> >> >> > 2: >> >> >> > >> >> >> > load'task' >> >> >> > shell 'diff ',f1,' ',f2 >> >> >> > >> >> >> > -- >> >> >> > David Mitchell >> >> >> > >> >> >> > On 11/20/2011 8:09, Ian Clark wrote: >> >> >> >> Has anyone written a verb to compare two scripts? (Just to save me >> >> >> >> writing one...) >> >> >> >> >> >> >> >> Two literal nouns with LF-separated lines will do. Changed / >> deleted >> >> / >> >> >> >> inserted lines. >> >> >> >> >> >> ---------------------------------------------------------------------- >> >> >> >> For information about J forums see >> >> http://www.jsoftware.com/forums.htm >> >> >> >> >> >> >> > >> ---------------------------------------------------------------------- >> >> >> > For information about J forums see >> >> http://www.jsoftware.com/forums.htm >> >> >> > >> >> >> >> ---------------------------------------------------------------------- >> >> >> For information about J forums see >> http://www.jsoftware.com/forums.htm >> >> >> >> >> > ---------------------------------------------------------------------- >> >> > For information about J forums see >> http://www.jsoftware.com/forums.htm >> >> > >> >> ---------------------------------------------------------------------- >> >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> >> > ---------------------------------------------------------------------- >> > For information about J forums see http://www.jsoftware.com/forums.htm >> > >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm