'Add ``hypothesis`` to the stack.
Removes lowest scoring hypothesis if the stack is full.
After insertion, hypotheses that score less than
``beam_threshold`` times the score of the best hypothesis
are removed.'

def push(self, hypothesis):

    self.items.append(hypothesis)
    self.items.sort(key=(lambda h: h.score()), reverse=True)
    while (len(self.items) > self.max_size):
        self.items.pop()
    self.threshold_prune()
