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

Clarity on Levenshtein ratio #11

Open
Praful932 opened this issue May 18, 2022 · 0 comments
Open

Clarity on Levenshtein ratio #11

Praful932 opened this issue May 18, 2022 · 0 comments

Comments

@Praful932
Copy link

Hello @snukky, I wanted some clarity on this piece of code

def __levenshtein_ratio(self, old_sent, new_sent):
    old_words = old_sent.split()
    new_words = new_sent.split()

   min_words = min(len(old_words), len(new_words))
   dist = self.__levenshtein_on_words(old_words, new_words)
   ratio = dist / float(min_words) * math.log(min_words,
   self.LEVENSHTEIN_RATIO_LOG_BASE)

particularly how the ratio is calculated and how it can be interpreted
Is it a scaled version of - how much in ratio will the smaller string need to be operated on given the distance?
Could you point me to relevant literature if available, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant