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 ( ) ] ) ; }
Get an array of Spans and their associated tokens and obtains an array of Strings containing the type for each Span .