Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cross-diff similarities check #395

Open
marcofbbr opened this issue Jul 30, 2024 · 3 comments
Open

Implement cross-diff similarities check #395

marcofbbr opened this issue Jul 30, 2024 · 3 comments

Comments

@marcofbbr
Copy link

marcofbbr commented Jul 30, 2024

Hi

If you compare the attached files, you will notice that the first column of subnets on the left is the same but the plugin does not recognize it.

If you delete the line which includes the word "Network" on one of the 2 files, then the comparison works as expected.

Screenshot 2024-07-30 160648

new 25.txt
new 24.txt

EDIT reason: rephrased.

@pnedev
Copy link
Owner

pnedev commented Jul 31, 2024

Hello @marcofbbr ,

That is perfectly normal because the "Network..." lines match perfectly and provide a context for the local sub-matches.
Currently if the algorithm finds matching lines/sections then the other diffs are split in two sub-groups - below and after the matching sections. Those sub-groups are consequently matched for similarities. That means that the order of lines in the files actually matter - if you move the "Network..." line in one of the files to match the position it has in the other file things will also change.
In your compare case you'll need to "help" a bit the comparison to actually find the differences you are particularly interested in (by ignoring certain lines/symbols or by reordering the lines after the first comparison to change the compare context according to your needs).

P.S. If you don't have further comments or suggestions I will close this issue thread after a week.

BR

@marcofbbr
Copy link
Author

marcofbbr commented Jul 31, 2024

Thanks for your feedback.
I understand your logic.
Please note that I am not a coder so I am giving my feedback trying to improve the accuracy for my specific case hoping that perhaps this could be useful on a general level.
Sometimes it is a bit tricky or time consuming to "help" the plugin if the output is very long .
Wouldn't be possible/worth to do an additional check/compare for such cases
If the algorithm would compare, in addtion to what you already described, the initial (or even internal) part of each string marked with +/- it could notice that there are some similarities . For example : Line 8 in the picture, left side, is very similar to line 7 right side. Based on that, the plugin could inform the user with an icon about a misaligned similarity. So the icons in the output I provided would be a new icon instead of a misleading + and -. Potentially a scale of mismatching similarity (high, mid, low) could be defined based on the percentage of text matching. Such info can be included in the icon.

Perhaps another approach to avoid such condition (at least in this case) could be to eliminate the perfect matches automatically or with user interaction from both files and run the compare again . Not sure it would be worth to develop such feature, but in my specific case it would fix the problem

I hope this helps.

@pnedev
Copy link
Owner

pnedev commented Aug 1, 2024

Thank you for the feedback and the suggestions. 👍

@pnedev pnedev changed the title Comparison partial fail Implement cross-diff similarities check Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants