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

Simplify digram generation and sort #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justducky
Copy link

Simplify digram generation and sort
Sort digram frequency count

Sort digram frequency count
@rlvaugh
Copy link
Owner

rlvaugh commented Sep 30, 2020

Thank you, I will update the next version of the book to include your changes. It is going into the 4th printing now so this will probably occur sometime in 2021.

@rlvaugh
Copy link
Owner

rlvaugh commented Jul 1, 2021

We are getting ready for the next printing and I noticed that your code is doubling the frequency count for digrams like "vo." It looks like you overwrite the digrams set with this line:

digrams = sorted([''.join(i) for i in permutations(name, 2)])

When you print out the list of digrams, you'll see that several are duplicated, which can't happen with a set data type. This is overall a good approach however, and I plan to include an edited version in the update.

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

Successfully merging this pull request may close these issues.

2 participants