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

feat: update object similarity calculation #9

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

deblockt
Copy link
Owner

@deblockt deblockt commented Sep 25, 2023

  • with this change structure similarity is 60% of the result and value similarity is 40% of the result
  • the value similarity is now number of value match / number of expected property instead of number of value match / number of matched keys. This avoids to have a high ratio if only one key match the expected object.

before:

  • { "a": 1, "d": 5 } and { "a": 1, "d": 2 }: have a value similarity equals to 0.5
  • { "a": 1, "d": 5 } and { "a": 1 }: have a value similarity equals to 1

now:

  • { "a": 1, "d": 5 } and { "a": 1, "d": 2 }: have a value similarity equals to 0.5
  • { "a": 1, "d": 5 } and { "a": 1 }: have a value similarity equals to 0.5

close #8

- now structure similarity is 60% of the result and value similarity is 40% of the result
- the value similarity is now `number of value match / number of expected property` instead of `number of value match / number of matched keys`. This avoids to have a high ratio if only one key match the expected object.
@deblockt deblockt self-assigned this Sep 25, 2023
@deblockt deblockt merged commit 2aea9df into master Sep 26, 2023
1 check passed
@deblockt deblockt deleted the fix/objectSimiraityRate branch October 5, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant