code: public static String[] getTypesFromSpans(final Span[] spans,
        final String[] tokens) {
      final List<String> tagsList = new ArrayList<String>();
      for (final Span span : spans) {
        tagsList.add(span.getType());
      }
      return tagsList.toArray(new String[tagsList.size()]);
    }
docs: Get an array of Spans and their associated tokens and obtains an array of
  Strings containing the type for each Span.
  
  @param spans
  the array of Spans
  @param tokens
  the array of tokens
  @return an array of string with the types