difflicious
difflicious copied to clipboard
Approximate element pairing for sets
This tries to implement #66 in the following manner:
- Introduces difference counts (one for the number of differences, and another for the number of ignored differences)
- Abstracts pairing functions into
PairingFnwhich can be equals-based or differ-based:- Equals-based functions work the same way as they used to
- Differ-based pairing can be either approximate, using the default item differ or can rely on a user-specified differ instance. This is to allow for user customizability.
- Differ-based pairing functions take an additional parameter for difference count threshold.
- The difference count is compared against the threshold specified in the pairing function to then match similar elements.
I tried to approach this in as common-sense way as possible and made some assumptions when implementing this such as using the approximate pairing function by default and specifying difference threshold to be 1, but I am open to discussing/adjusting them as needed.