docs: public static List<TaggedSequence<WordAndPos, HeadedSyntacticCategory>> reformatTrainingExamples(
        Collection<CcgExample> ccgExamples, boolean ignoreInvalid) {
      List<TaggedSequence<WordAndPos, HeadedSyntacticCategory>> examples = Lists.newArrayList();
      for (CcgExample example : ccgExamples) {
        Preconditions.checkArgument(example.hasSyntacticParse());
        List<WordAndPos> taggedWords = WordAndPos.createExample(example.getSentence().getWords(),
            example.getSentence().getPosTags());
        List<HeadedSyntacticCategory> syntacticCategories = example.getSyntacticParse()
            .getAllSpannedHeadedSyntacticCategories();
  
        if (!ignoreInvalid || !syntacticCategories.contains(null)) {
          examples.add(new ListTaggedSequence<WordAndPos, HeadedSyntacticCategory>(taggedWords, syntacticCategories));
        } else {
          List<SyntacticCategory> unheadedCategories = example.getSyntacticParse().getAllSpannedLexiconEntries();
          System.out.println("Discarding sentence: " + taggedWords);
          for (int i = 0; i < taggedWords.size(); i++) {
            if (syntacticCategories.get(i) == null) {
              System.out.println("No headed syntactic category for: " + taggedWords.get(i) + " " + unheadedCategories.get(i));
            }
          }
        }
      }
      return examples;
    }