

def get_backoff(self, ngram):
    assert (len(ngram) == 3)
    ngram = tuple(ngram)
    if (ngram in self.lm):
        return 1.0
    elif ((ngram[:2] in self.lm) and (self[1:] in self.lm)):
        return 0.8
    elif (ngram[1:] in self.lm):
        return 0.6
    elif ((ngram[:2] in self.lm) and (ngram[2:] in self.lm)):
        return 0.4
    elif ((ngram[1:2] in self.lm) and (ngram[2:] in self.lm)):
        return 0.3
    elif (ngram[2:] in self.lm):
        return 0.2
    else:
        return 0.1

dataset/ETHPy150Open qe-team/marmot/marmot/features/lm_feature_extractor.py LMFeatureExtractor.get_backoff/VarMisuse@59/69 `ngram`->`self`