def _group_chunks_by_entities(self, chunks, entities):
for entity in entities:<EOL><INDENT>chunks_to_concat = chunks.get_overlaps(<EOL>entity['<STR_LIT>'], len(entity['<STR_LIT:content>']))<EOL>if not chunks_to_concat:<EOL><INDENT>continue<EOL><DEDENT>new_chunk_word = u'<STR_LIT>'.join([chunk.word for chunk in chunks_to_concat])<EOL>new_chunk = Chunk(new_chunk_word)<EOL>chunks.swap(chunks_to_concat, new_chunk)<EOL><DEDENT>return chunks<EOL>
Groups chunks by entities retrieved from NL API Entity Analysis.

        Args:
          chunks (:obj:`budou.chunk.ChunkList`): List of chunks to be processed.
          entities (:obj:`list` of :obj:`dict`): List of entities.

        Returns:
          A chunk list. (:obj:`budou.chunk.ChunkList`)