Skip to content

Cost value can't exceed 2? #30

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

Open
peilinUWU opened this issue Aug 23, 2022 · 2 comments
Open

Cost value can't exceed 2? #30

peilinUWU opened this issue Aug 23, 2022 · 2 comments

Comments

@peilinUWU
Copy link

Using the given example:

insert_costs = np.ones(128, dtype=np.float64) 
insert_costs[ord('D')] = 1.5
print(lev('BANANAS', 'BANDANAS', insert_costs=insert_costs))  # prints '1.5'

We get a printout 1.5, no problem. If I change the cost to a higher value, say 5, then it prints 2.0. Am I missing something?

@dsu1995
Copy link

dsu1995 commented Aug 24, 2022

In this paricular case, it would be cheaper to substitute A -> D (cost 1), then insert the A back (cost 1), yielding a lower cost of 2:

  • BANANAS
  • BANDNAS
  • BANDANAS

@peilinUWU
Copy link
Author

peilinUWU commented Aug 25, 2022

Edited: Thanks that makes sense!

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

2 participants