'Update *test_sents* by applying *rule* everywhere where its
conditions are met.'

def _apply_rule(self, rule, test_sents):

    update_positions = set(self._positions_by_rule[rule])
    new_tag = rule.replacement_tag
    if (self._trace > 3):
        self._trace_apply(len(update_positions))
    for (sentnum, wordnum) in update_positions:
        text = test_sents[sentnum][wordnum][0]
        test_sents[sentnum][wordnum] = (text, new_tag)
