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

Refactor EditDistance, EditDistanceDouble, LongestCommonSubsequenceDistance hierarchy #346

Closed
cicirello opened this issue May 30, 2023 · 0 comments · Fixed by #347
Closed
Assignees
Labels
Milestone

Comments

@cicirello
Copy link
Owner

cicirello commented May 30, 2023

Summary

Within the package org.cicirelo.sequences.distance, the classes EditDistance, EditDistanceDouble, LongestCommonSubsequenceDistance form a hierarchy. EditDistance currently has 2 constructors, one for int valued costs and the other for double-valued costs, delegating the double-valued case to its current super class EditDistanceDouble, and with documented exceptions if one tries to use the int-valued distance methods when double values passed for the costs. This was a very strange choice to make at the time. It stemmed from some refactoring, and specific reasons are no longer clear. But regardless of the rationale at the time, it was a bad choice.

Refactor to clean this up, including removing the double-valued costs constructor of EditDistance, and removing EditDistance's dependence upon EditDistanceDouble by removing the extends.

Clean up the documentation as necessary.

This will be a breaking change.

Also, review and consider refactoring the logic of the algorithm implementation itself.

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

Successfully merging a pull request may close this issue.

1 participant