[sword-devel] [jsword-devel] Parallel View with Differences
DM Smith
dmsmith555 at yahoo.com
Fri May 25 11:00:27 MST 2007
Martin,
It is in svn under http://www.crosswire.org/svn/jsword/trunk/common/
src/main/java/org/crosswire/common/diff
Test cases at http://www.crosswire.org/svn/jsword/trunk/common/src/
test/java/org/crosswire/common/diff
(note diff_patch_match.java in test is going away.)
For an example of how I use it see: http://www.crosswire.org/svn/
jsword/trunk/jsword/src/main/java/org/crosswire/jsword/book/
BookData.java
(This code will be moved to a better place. Right now this location
is a hack. So snag a copy soon.)
Wikipedia has lots of C code for the fundamental algorithms. So you
can use those to help you port it to C/C++.
If you do port it and add it to Sword, I'll be glad to maintain my
version and Sword's in parallel.
One of the things I hope to do is change the algorithm to difference
entire words rather than characters.
Also the performance is adequate in both time and space if it is used
a verse at a time and on no more than 50 or so verses.
There is one class in there that is not related to producing/using
diffs and that is Distance. I just added it to allow me to guess at a
module name from malformed input.
I'm probably going to do a bit more cleanup on it. (e.g. parameter
and variable name changes, add documentation, fix documentation, ...)
Enjoy,
DM
On May 25, 2007, at 12:39 PM, Martin Gruner wrote:
> Hi DM,
>
> I'm highly interested in your code for the diff display. If
> possible, I'd like
> to integrate this into BT as well.
>
> mg
>
> Am Donnerstag, 24. Mai 2007 schrieb DM Smith:
>> (cross-posting to sword-devel for their feedback, too)
>>
>> I have just committed a first pass at adding a comparison parallel
>> view
>> to JSword.
>>
>> (I ported JavaScript code from Neil Fraser into Java. It is also
>> available from him in Python. I don't think it would be too hard
>> to port
>> my code to C++, if anyone is interested.)
>>
>> Right now the showing of parallel texts and diffs is hard coded
>> into the
>> code, but will change by release time, giving the user full control.
>>
>> Here is how it works today in BibleDesktop:
>> If you select a Bible that is not your default Bible, you get
>> parallel
>> view. If it is they are also same language, then you will see an
>> additional
>> column between the two, showing the differences.
>>
>> I'd like to get your feedback. Especially on how to allow the user to
>> choose to show the diff column or not.
>>
>> Here is what it looks like: (ESV is my default Bible and I am showing
>> the NASB [which I am working on for Lockman Publishing])
>>
>> A parallel view with differences between versions
>
>
More information about the sword-devel
mailing list