Hi Josiah

To explain it another way, the example diff you quoted earlier was "correct", 
in that it is an accurate depiction of a set of modifications which will turn 
the first string into the second. The problem is that what an algorithm sees as 
a reasonable way to display the differences may not match a human narrative of 
the changes. It's a general problem with diff engines, and they all devote a 
lot of attention to trying to improve human readability. The diff engine we're 
using is pretty much the state of the art. There's no magic solution: we can 
tweak the parameters that drive the heuristics used for diffing, but we will 
find that any given set of parameters will be good in some scenarios but not 
others. There's no magic solution which will work in all situations; that's 
what I meant by saying that it's one of those tricky problems of computer 
science :)

Best wishes

Jeremy


--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 19 Mar 2019, at 20:36, @TiddlyTweeter <tiddlytwee...@assays.tv> wrote:
> 
> Jeremy
> 
> I definitely think access to change parameters could be helpful.
> 
> In the case of SNR one needs a logical consistent representation. It doesn't 
> matter if its very long--so long as its consistent.
> 
> The biggest problem at the moment is the Diff. Engine creates a mix of 
> representations that can quickly get visually inconsistent. 
> 
> That is seriously confusing for the end user who is already grappling with 
> learning regular expression syntax.
> 
> Best wishes
> Josiah
> 
>> On Tuesday, 19 March 2019 20:45:00 UTC+1, Jeremy Ruston wrote:
>> Hi Josiah, Mohammad,
>> 
>> The core uses Google's Diff-Match-Patch library by Neil Fraser:
>> 
>> https://github.com/google/diff-match-patch
>> 
>> It turns out that reliably creating human-readable diffs is one of those 
>> tricky problems in computer science that doesn't have a clean solution. The 
>> docs for the library discuss some parameters that can be tweaked to control 
>> things:
>> 
>> https://github.com/google/diff-match-patch/wiki/API
>> 
>> Maybe we should expose all of the parameters as attributes on the 
>> DiffTextWidget, making it easier for people to experiment with different 
>> settings.
>> 
>> Best wishes
>> 
>> Jeremy
>> 
>> --
>> Jeremy Ruston
>> jer...@jermolene.com
>> https://jermolene.com
>> 
>>> On 19 Mar 2019, at 15:13, Mohammad <mohammad...@gmail.com> wrote:
>>> 
>>> What Josiah said can be tested on SNR at
>>> 
>>> https://kookma.github.io/TW-Commander/
>>> 
>>> It seems the Tiddlywiki diff-text works fine for simple cases like 
>>> alphanumeric but working with more complex cases like regexp, it encounter 
>>> difficulties.
>>> 
>>> --Mohammad
>>> 
>>>> On Tuesday, March 19, 2019 at 5:08:54 PM UTC+3:30, @TiddlyTweeter wrote:
>>>> The Difference Engine is an incredibly useful feature of TW. For writers, 
>>>> for coders, for versioning systems that are now commonly used. And, more 
>>>> recently, in tools like Mohammad's regular expressions based 
>>>> Search-n-Replace.
>>>> 
>>>> The problem is its visual presentation (it does not harm the writing, it 
>>>> just) under some circumstances is extremely misleading.
>>>> 
>>>> For instance ... Actually the edit here was only to remove < & > but the 
>>>> differences shown are very confusing with many items in green and pink 
>>>> that should not be, and with inconsistent presentation that is even more 
>>>> confusing.
>>>> 
>>>> I wonder if it can be made more accurate?
>>>> 
>>>> 
>>>> 
>>>> Best wishes
>>>> Josiah 
>>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "TiddlyWiki" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to tiddlywiki+...@googlegroups.com.
>>> To post to this group, send email to tiddl...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/tiddlywiki.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywiki/f66e485c-50c8-4ca0-9c92-47c1363c9ca3%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/b20a5e11-8a1e-4b69-931d-2f58bce7da60%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/C4FC3D62-22C8-4808-A29E-4D2E976EF4D4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to