FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Changed max to argmax by Chipe1 · Pull Request #455 · aimacode/aima-python · GitHub

Repository navigation

Changed max to argmax - #455

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

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

Conversation

Chipe1 commented Mar 31, 2017

Copy link
Copy Markdown
Contributor

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
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 commented Apr 6, 2017

Copy link
Copy Markdown
Member

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

Chipe1 closed this Apr 7, 2017
Chipe1 deleted the texterr branch April 7, 2017 04:08

Chipe1 commented Apr 7, 2017

Copy link
Copy Markdown
Contributor Author

Updated PR in #481

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL