Solved

Text comparison

Posted on 2002-06-25
4
161 Views
Last Modified: 2010-04-04
Hi all.

Has anyone had to put a differencing engine into their apps? That's what I'm faced with. Part of the app records a history of small snippets of text (3k or so on average) that are held in a database. I need to be able to visually compare the text.

Something like WinDiff, VisualDiff, or the GNU diff engine or whatever, but I want to incorporate the engine into a Delphi app (or talk to a COM obj would be fine) so that I can present the results in my own format.

Anyone know of such a library?

Thanks,
Phil.
0
Comment
Question by:philipleighs
4 Comments
 
LVL 14

Expert Comment

by:AvonWyss
ID: 7108915
Shall it be line-based? In this case, it's not that hard to write for yourself. Just compare two lines (let's call the A and B), if they are the same, go to the next pair. If they differ, search the A line in the next N (where N is the maximal edit distance) lines of B. If not found, skip to the next A, etc. Doing this, you'll resync (when you find matching line pairs) or you will eventually come to file end.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 7109035
DLSuperC now has a way to invoke it with command line parameters, so you could display the results after it did its comparison.  It is very thorough and fast.

You can contact Don Ludlow (dlsuperc.com), the DLSuperC developer, about features you might need.  He's pretty responsive to feature requests.  He wrote this in Delphi.
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 500 total points
ID: 7109855
0
 
LVL 3

Author Comment

by:philipleighs
ID: 7111199
TOndrej,

The component uses the Eugene Myers routine which is what I was hoping for.

I've looked at the code and it's suitable for my purposes.

Thanks,
Phil.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question