Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Diff between two arrays

by apsyrtes (Beadle)
on Jul 01, 2003 at 16:06 UTC ( #270519=note: print w/replies, xml ) Need Help??

in reply to Diff between two arrays

How are you to determine that "burritoes" (sic) is a replacement for "tacos" ?? What are the rules that determine that, without also determining that "Do" is a replacement for "I"?

I'm sure you have an END RESULT in mind (ie. why are you trying to do this?), and you are currently trying to solve a problem that is getting in the way of your solution... if you can say what you are trying to achieve, likely you'll find there somebody has a better SOLUTION so that you won't have to solve this problem you are dealing with.

Jason W.

Replies are listed 'Best First'.
Re: Re: Diff between two arrays
by fletcher_the_dog (Friar) on Jul 01, 2003 at 16:51 UTC
    This is the end result I have in mind. What I need is a map of the connection between the two arrays. The arrays represent a certain set of tokens in two different files. What I want is very similiar to doing a diff between two files, except I don't want it on a character by character basis or a line by line bases, I want it on a token by token bases where a token matches m/(\w+|\S)/. What I need the map for is not important (well, it is to me, but I already know that I need it for what I am doing). In response to your other question, "How are you to determine that "burritoes" (sic) is a replacement for "tacos" ?", I would determine that the same way that I would determine "a" is a replacement for "e" in the between "tall" and "tell". The algorithm would be something like "IF everything in sequence A is the same as everything in sequence B except for the token at index N, THEN token B[N] replaced A[N].

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://270519]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-01-20 03:35 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (226 votes). Check out past polls.