#NEWLINE# def read_block( self , stream ) : #NEWLINE# #INDENT# 'Reads one paragraph at a time.' #NEWLINE# block = [ ] #NEWLINE# for para_str in self . _para_block_reader ( stream ) : #NEWLINE# #INDENT# para = [ ] #NEWLINE# for sent_str in self . _sent_tokenizer . tokenize ( para_str ) : #NEWLINE# #INDENT# sent = [ str2tuple ( s , self . _sep ) for s in self . _word_tokenizer . tokenize ( sent_str ) ] #NEWLINE# if self . _tag_mapping_function : #NEWLINE# #INDENT# sent = [ ( w , self . _tag_mapping_function ( t ) ) for ( w , t ) in sent ] #NEWLINE# #UNINDENT# if ( not self . _tagged ) : #NEWLINE# #INDENT# sent = [ w for ( w , t ) in sent ] #NEWLINE# #UNINDENT# if self . _group_by_sent : #NEWLINE# #INDENT# para . append ( sent ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# para . extend ( sent ) #NEWLINE# #UNINDENT# #UNINDENT# if self . _group_by_para : #NEWLINE# #INDENT# block . append ( para ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# block . extend ( para ) #NEWLINE# #UNINDENT# #UNINDENT# return block