def add_morphology_to_examples(
    examples: List[ScoredNGram],
    morph_rules: Dict[str, Dict[str, str]]) -> List[ScoredMorphedNGram]:
  """Adds morphology to generated words based on the provided rules.

  Args:
    examples: List of input words and scores.
    morph_rules: Set of rules to edit words based on part of speech and suffix
      substitution.

  Returns:
    List of words with a dictionary of part of speech to conjugated word form
      added.
  """
  morphed_examples = []
  for example in examples:
    if (morphology := _morph_by_rules(example.word, morph_rules)) is not None:
      morphed_examples.append(ScoredMorphedNGram(example, morphology))
  return morphed_examples
Adds morphology to generated words based on the provided rules.

  Args:
    examples: List of input words and scores.
    morph_rules: Set of rules to edit words based on part of speech and suffix
      substitution.

  Returns:
    List of words with a dictionary of part of speech to conjugated word form
      added.
  
language/wino_dict/create_new_words.py