fix scoring function

This commit is contained in:
Luna 2023-06-10 00:50:48 -03:00
parent 8a3a47a8af
commit 18da5d7972

View file

@ -264,8 +264,8 @@ async def fight(ctx):
def score(danbooru_tags: Set[str], interrogator_tags: Set[str]) -> decimal.Decimal:
tags_in_danbooru = danbooru_tags | interrogator_tags
tags_not_in_danbooru = danbooru_tags - interrogator_tags
tags_in_danbooru = danbooru_tags.intersection(interrogator_tags)
tags_not_in_danbooru = interrogator_tags - danbooru_tags
return decimal.Decimal(
len(tags_in_danbooru) - len(tags_not_in_danbooru)
) / decimal.Decimal(len(danbooru_tags))