Пример #1
0
class SenseProfile:
    # Sense profile is an individual sense
    # A question is generated based on the word sense
    # A score is given based on the word sense
    # Each sense has an associated history of questions that have been asked
    def __init__(self, sense, parent):
        self.parent = parent
        self.sense = sense
        self.score = 0.0
        self.proficiency = AccuracyModel()

    def __repr__(self):
        return "{}".format((self.sense, self.score))

    def __eq__(self, other):
            return self.sense == other.sense

    def __hash__(self):
        return hash((self.sense))
    # Update Score for the sense

    def update_score(self, correct):
        # Initial Version
        # if correct:
        #     self.score += 0.2
        # else:
        #     self.score -= 0.2
        self.score = self.proficiency.update(correct) # Has sideeffect
        self.parent.update_score()
Пример #2
0
 def __init__(self, sense, parent):
     self.parent = parent
     self.sense = sense
     self.score = 0.0
     self.proficiency = AccuracyModel()