Pine - Victoria Duke and Michelle Bodart#32
Open
VictoriaDuke wants to merge 14 commits intoAda-C16:masterfrom
Open
Pine - Victoria Duke and Michelle Bodart#32VictoriaDuke wants to merge 14 commits intoAda-C16:masterfrom
VictoriaDuke wants to merge 14 commits intoAda-C16:masterfrom
Conversation
…_in_english_dictionary() to ignore input word capitalization.
jbieniosek
reviewed
Oct 6, 2021
jbieniosek
left a comment
There was a problem hiding this comment.
Great work on this project, nicely done with the extension and the test code for the extension! This project is green.
Comment on lines
+73
to
+77
| for letter in letter_bank: | ||
| if letter_bank.count(letter) > LETTER_POOL.count(letter): | ||
| is_freq_correct = False | ||
| #Letter frequency is incorrect. Breaks the loop and creates new hand of letter. | ||
| break |
|
|
||
| def uses_available_letters(word, letter_bank): | ||
| pass | ||
| word = word.upper() |
Comment on lines
+87
to
+92
| if letter in letter_bank and word.count(letter) <= letter_bank.count(letter): | ||
| continue | ||
| else: | ||
| #Will return False if input word uses letters not in letter_bank, | ||
| # and/or over the quantity of the letter available in letter_bank. | ||
| return False |
There was a problem hiding this comment.
Another way to write this conditional is:
Suggested change
| if letter in letter_bank and word.count(letter) <= letter_bank.count(letter): | |
| continue | |
| else: | |
| #Will return False if input word uses letters not in letter_bank, | |
| # and/or over the quantity of the letter available in letter_bank. | |
| return False | |
| if not letter in letter_bank or word.count(letter) > letter_bank.count(letter): | |
| return False |
| score += SCORE_CHART[letter] | ||
| if len(word) >= 7: | ||
| score += 8 | ||
| return score |
| highest_score = score | ||
| highest_words = [word] | ||
| elif highest_score == score: | ||
| highest_words.append(word) |
Comment on lines
+124
to
+129
| def word_in_english_dictionary(word): | ||
| word = word.lower() | ||
| if word in english_dict.keys(): | ||
| return True | ||
| else: | ||
| return False |
Comment on lines
+119
to
+122
| for word in highest_words: | ||
| if len(word) == 10: | ||
| return(word, highest_score) | ||
| return(min(highest_words, key=len), highest_score) |
| is_valid = word_in_english_dictionary(word) | ||
|
|
||
| # Assert | ||
| assert is_valid == False No newline at end of file |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We did an extension on the project by creating a function to check if the word is in the English dictionary. We imported the package english-dictionary 1.0.24 (pip install english-dictionary).