def align_chunk_with_ner(self, ner_xml_path, i_chunk, o_chunk):
<EOL>input_iter = i_chunk.__iter__()<EOL>all_ner = xml.dom.minidom.parse(open(ner_xml_path))<EOL>for ner_dom in all_ner.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>stream_item = next(input_iter)<EOL>stream_id = ner_dom.attributes.get('<STR_LIT>').value<EOL>if stream_item.stream_id is None:<EOL><INDENT>assert not stream_id, '<STR_LIT>' % stream_id<EOL>logger.critical('<STR_LIT>')<EOL>continue<EOL><DEDENT>assert stream_id and stream_id == stream_item.stream_id,'<STR_LIT>' % (stream_id, stream_item.stream_id)<EOL>if not stream_item.body:<EOL><INDENT>continue<EOL><DEDENT>tagging = Tagging()<EOL>tagging.tagger_id = self.tagger_id  <EOL>'''<STR_LIT>'''<EOL>tagging.generation_time = streamcorpus.make_stream_time()<EOL>stream_item.body.taggings[self.tagger_id] = tagging       <EOL>sentences, relations, attributes = self.get_sentences(ner_dom)<EOL>stream_item.body.sentences[self.tagger_id] = sentences    <EOL>stream_item.body.relations[self.tagger_id] = relations    <EOL>stream_item.body.attributes[self.tagger_id] = attributes  <EOL>logger.debug('<STR_LIT>' % stream_item.stream_id)<EOL>'''<STR_LIT>'''<EOL>if '<STR_LIT>' in self.config and self.config['<STR_LIT>']:<EOL><INDENT>assert '<STR_LIT>' in self.config, '<STR_LIT>'<EOL>aligner = AlignmentStrategies[ self.config['<STR_LIT>'] ]<EOL>aligner( stream_item, self.config['<STR_LIT>'] )<EOL><DEDENT>gc.collect()<EOL>try:<EOL><INDENT>o_chunk.add(stream_item)<EOL><DEDENT>except MemoryError as exc:<EOL><INDENT>msg = traceback.format_exc(exc)<EOL>msg += make_memory_info_msg()<EOL>logger.critical(msg)<EOL>raise PipelineOutOfMemory(msg)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>o_chunk.close()<EOL>logger.info('<STR_LIT>' % ner_xml_path)<EOL><DEDENT>except MemoryError as exc:<EOL><INDENT>msg = traceback.format_exc(exc)<EOL>msg += make_memory_info_msg()<EOL>logger.critical(msg)<EOL>raise PipelineOutOfMemory(msg)<EOL><DEDENT>
iterate through ner_xml_path to fuse with i_chunk into o_chunk