Merge pull request #424 from emmanvg/remove-rounding-semantic-equivalence

Semantic Equivalence - partial_string_based()
pull/1/head
Chris Lenk 2020-07-08 12:27:18 -04:00 committed by GitHub
commit 2f08ad03b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -365,7 +365,7 @@ def partial_string_based(str1, str2):
"""
from rapidfuzz import fuzz
result = round(fuzz.token_sort_ratio(str1, str2))
result = fuzz.token_sort_ratio(str1, str2)
logger.debug("--\t\tpartial_string_based '%s' '%s'\tresult: '%s'", str1, str2, result)
return result / 100.0

View File

@ -787,7 +787,7 @@ def test_semantic_equivalence_prop_scores():
tool2 = stix2.v21.Tool(id=TOOL_ID, **TOOL2_KWARGS)
stix2.Environment().semantically_equivalent(tool1, tool2, prop_scores)
assert len(prop_scores) == 4
assert round(prop_scores["matching_score"], 1) == 8.8
assert round(prop_scores["matching_score"], 1) == 8.9
assert round(prop_scores["sum_weights"], 1) == 100.0