0

The specs for this problem say that log.html has been implemented for us and that we don't need to make any changes for it to work properly, but mine only lists substitutions (jpg below)

enter image description here

My matrix prints correctly with all the associated operations, and also calculates the correct edit distances for test cases. Any idea to what the problem might be?

1 Answer 1

1

The log relies on your associated operations. Maybe you accidentally use strings and not the required enumeration values.

You should use

Operation.INSERTED if you reached this field by insertion (the field on the left)

Operation.DELETED if you reached this by deletion (the field above)

Operation.SUBSTITUTED if you reach the field from the field upper left (regardless of whether the characters were the same, so had any cost associated to the operation)

Anything neither Operation.INSERTED, Operation.DELETED, or None is considered the same as Operation.SUBSTITUTED, which is what is happening here.

Those are used only for finding the path, so you won't see the mistake in the matrix.

1
  • That was the problem; I was using strings for the operations. Many thanks!
    – Scott J.
    Aug 8, 2018 at 21:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .