def update_weight(self, word, guess):
    'Update the weighting on a word based on the most recent guess.\n        \n        Args:\n            word (str): The word to update. Should be in the index of self.words.\n            guess (bool): Whether the guess was correct or not.\n        '
    row = self.words.loc[word]
    if guess:
        row.Correct += 1
    else:
        row.Wrong += 1
    n_genders = len(self.structure['genders'])
    total = (row.Correct + row.Wrong)
    if (not (total % n_genders)):
        if row.Correct:
            wrongs_to_throw = min((row.Wrong - 1), (n_genders - 1))
            row.Wrong -= wrongs_to_throw
            row.Correct -= (n_genders - wrongs_to_throw)
        else:
            row.wrong -= n_genders
    row.Weight = (row.Wrong / (row.Correct + row.Wrong))
    self.words.loc[word] = row
Update the weighting on a word based on the most recent guess.

Args:
    word (str): The word to update. Should be in the index of self.words.
    guess (bool): Whether the guess was correct or not.
def update_weight(self, word, guess):
    'Update the weighting on a word based on the most recent guess.\n        \n        Args:\n            word (str): The word to update. Should be in the index of self.words.\n            guess (bool): Whether the guess was correct or not.\n        '
    row = self.words.loc[word]
    if guess:
        row.Correct += 1
    else:
        row.Wrong += 1
    n_genders = len(self.structure['genders'])
    total = (row.Correct + row.Wrong)
    if (not (total % n_genders)):
        if row.Correct:
            wrongs_to_throw = min((row.Wrong - 1), (n_genders - 1))
            row.Wrong -= wrongs_to_throw
            row.Correct -= (n_genders - wrongs_to_throw)
        else:
            row.wrong -= n_genders
    row.Weight = (row.Wrong / (row.Correct + row.Wrong))
    self.words.loc[word] = row