Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

One of the features in our project is to implement a comparison algorithm between two versions of text and provide a % change between the two versions. While I was researching, I came across google java-diff-utils project.

Has anyone used this for comparing text using java-diff-utils ? Using this utility, I can get a list of "delta" which I assume I can use it for the % of difference between two versions of the text? Is this a correct way of doing this?

If you have done any text comparison algorithm using Java, could you give me some pointers?

share|improve this question

1 Answer 1

What does "the % of difference" mean? If you start with a block of text and replace the characters in every other word with "q"s has it changed by 50%? If every other word is replaced with a single "q" has it changed by more than 50%? How much more?

I think the problem is too complex to have a single number as the answer.

This is normally handled with 3 numbers; inserted, deleted & replaced. But the definition of "replaced" can become problematic.

share|improve this answer
    
There are ways to define meaningful metrics on this but you’re right that it’s certainly not trivial. –  Konrad Rudolph Apr 19 '12 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.