def initRule(cls, src, tgt, probs): term_count = 0 for tgt_term in tgt.split(): if tgt_term == 'X__1' or tgt_term == 'X__2': continue term_count += 1 return RuleItem(src, tgt, FeatureManager.buildRuleFeats(probs, term_count))