code: public static void annotateChunkTokens(CoreMap chunk, Class tokenChunkKey, Class tokenLabelKey)
    {
      List<CoreLabel> chunkTokens = chunk.get(CoreAnnotations.TokensAnnotation.class);
      if (tokenLabelKey != null) {
        String text = chunk.get(CoreAnnotations.TextAnnotation.class);
        for (CoreLabel t: chunkTokens) {
          t.set(tokenLabelKey, text);
        }
      }
      if (tokenChunkKey != null) {
        for (CoreLabel t: chunkTokens) {
          t.set(tokenChunkKey, chunk);
        }
      }
    }
docs: Annotates tokens in chunk
  @param chunk - CoreMap representing chunk (should have TextAnnotation and TokensAnnotation)
  @param tokenChunkKey - If not null, each token is annotated with the chunk using this key
  @param tokenLabelKey - If not null, each token is annotated with the text associated with the chunk using this key