Skip to content

Checking for null case should be done at the token bag level for the Jacard Similarity #24

Description

@OlivierBinette

The check for null case should be done at the token bag level rather than the string level:

if len(s) + len(t) == 0:

I would recommend refactoring jaccard.py as follows:

  1. Have the jacard() function take two token sets as arguments and compute their jaccard similarity (overlap percentage). Checking for empty token bags should be done here.
  2. Have the compare() function deal with the tokenization and anything else (e.g. transforming the distance to a similarity).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions