Skip to content

Changed max to argmax#455

Closed
Chipe1 wants to merge 2 commits into
aimacode:masterfrom
Chipe1:texterr
Closed

Changed max to argmax#455
Chipe1 wants to merge 2 commits into
aimacode:masterfrom
Chipe1:texterr

Conversation

@Chipe1
Copy link
Copy Markdown
Contributor

@Chipe1 Chipe1 commented Mar 31, 2017

Changed max() to argmax() to make code easier to read.

Comment thread text.py
for c in alphabet if c not in state])

search_list = [c for c in alphabet if c not in state]
plainchar = argmax(search_list, key=lambda c: self.decoder.P1[c])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but I wonder which is clearer:
lambda c: self.decoder.P1[c]
or
self.decoder.P1.get

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean self.decoder.P1.getitem
I got an error when I tried self.decoder.P1.get AttributeError: 'UnigramTextModel' object has no attribute 'get'

@norvig
Copy link
Copy Markdown
Collaborator

norvig commented Apr 6, 2017

Sorry, I was late at getting to this, and now there is a conflict; can you fix?

@Chipe1 Chipe1 closed this Apr 7, 2017
@Chipe1 Chipe1 deleted the texterr branch April 7, 2017 04:08
@Chipe1
Copy link
Copy Markdown
Contributor Author

Chipe1 commented Apr 7, 2017

Updated PR in #481

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