-
Notifications
You must be signed in to change notification settings - Fork 0
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
Edit distance #16
Edit distance #16
Conversation
I fixed the second problem but this will no longer work with non-ASCII characters. Not an issue in my opinion. |
@AbyssalRemark can you check out this branch, try this code, and review it? |
Remove cruft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me. I think I would prefer working out that one bug before a merge but I think all round this is good to go.
} | ||
} | ||
|
||
impl<T> fmt::Display for Matrix<T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get why this is done this way I think but it would still be nice if we could print the grid out in context to the string so our human eyes can check it easier. But that's more then fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That didn't really show what I meant to look at very well. This was in reference to how the matrix display trait cant see the string and thus we cant print with more context. Maybe making just a printing function would be more ideal. But again, not a huge deal.
Delete, | ||
} | ||
/// Return the minimum amount of changes needed to transform `s1` into `s2`. | ||
pub fn edit_distance(s1: &str, s2: &str) -> usize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might care for where changes would need to happen in the future but that has nothing to do with the quality of the code.
Create Rust CI
For debugging edit distance |
From our debugging today, it looks like there are two problems:
|
Supersedes #15
Help would be much appreciated for the TODO items.
TODO:
test_single_character_deletion
doesn't seem to work for some reason.str.chars().nth()
because it makes the function O(n^2)