List<ChunkingExtractor> chunkingExtractors = Lists.newArrayList();
for (int typeID : entityTypeIDs) {
Predicate<IdentifiedAnnotation> hasTypeID = hasEntityType(typeID);
List<IdentifiedAnnotation> subEntities = Lists.newArrayList(Iterables.filter(entities, hasTypeID));
chunkingExtractors.add(new ChunkingExtractor("EntityTag", this.entityChunking, jCas, tokens, subEntities));
}
// add extractor for phase chunks
List<Chunk> chunks = JCasUtil.selectCovered(jCas, Chunk.class, sentence);
chunkingExtractors.add(new ChunkingExtractor("PhraseTag", this.phraseChunking, jCas, tokens, chunks));
// extract features for all tokens
int tokenIndex = -1;
int nChunkLabelsBefore = 2;
int nChunkLabelsAfter = 2;