diffx icon indicating copy to clipboard operation
diffx copied to clipboard

intelligent set diffs

Open adamw opened this issue 6 years ago • 3 comments

apart from computing additional/missing elements, we could try to pair up mismatching elements when diffing sets in an intelligent way, so that two (different) elements are paired up in the final diff using "minimal difference". Or maybe we could assume that elements should be paired if they have e.g. 3 differences at most?

adamw avatar Aug 16 '19 11:08 adamw

Do you have any examples where that could be useful?

ghostbuster91 avatar Jan 12 '21 08:01 ghostbuster91

Well if you have ... Set(Person("Adam", true, 10), Person("John", true, 20)) and Set(Person("Adam", fale, 10), Person("John", false, 20)) I'd like to have adam paired with adam nad john with john in the diff :)

adamw avatar Jan 12 '21 09:01 adamw

Sounds cool but, that would require additional entity in the library or the redesign of ObjectMatcher. Anyway, I think that there should also be some threshold value below which there is no point in matching two objects. The threshold value could be a parameter to the SmartObjectMatcher constructor, WDYT?

ghostbuster91 avatar Jan 24 '21 22:01 ghostbuster91