#NEWLINE# def ieer_headlines( ) : #NEWLINE# #INDENT# from nltk.corpus import ieer #NEWLINE# from nltk.tree import Tree #NEWLINE# print ( 'IEER: First 20 Headlines' ) #NEWLINE# print ( ( '=' * 45 ) ) #NEWLINE# trees = [ ( doc . docno , doc . headline ) for file in ieer . fileids ( ) for doc in ieer . parsed_docs ( file ) ] #NEWLINE# for tree in trees [ : 20 ] : #NEWLINE# #INDENT# print ( ) #NEWLINE# print ( ( '%s:\n%s' % tree ) )