docs: public static SpanFeatureAnnotation annotate(AnnotatedSentence sentence,
        FeatureVectorGenerator<StringContext> featureGenerator) {
      int numTerminals = sentence.size();
      Tensor[] featureVectors = new Tensor[numTerminals * (numTerminals + 1) / 2];
      for (int i = 0; i < numTerminals; i++) {
        for (int j = i; j < numTerminals; j++) {
          int spanIndex = getSpanIndex(i, j, numTerminals);
          featureVectors[spanIndex] = featureGenerator.apply(
              new StringContext(i, j, sentence));
        }
      }
      return new SpanFeatureAnnotation(featureVectors, numTerminals);
    }