def _get_rules_for_other_examples(induced_rules, other_examples):
  """Add rules for examples outside of sample that cannot be derived."""
  new_rules = set()
  for source_str, target_str in other_examples:
    goal_rule = qcfg_rule.QCFGRule(
        tuple(source_str.split()), tuple(target_str.split()), arity=0)
    if not derivation_utils.can_derive(goal_rule, induced_rules, None):
      new_rules.add(goal_rule)
  print("Added %s rules for examples outside of initial sample." %
        len(new_rules))
  return new_rules
Add rules for examples outside of sample that cannot be derived.
language/compgen/nqg/model/induction/induction_utils.py