#NEWLINE# def load_tag_dict( filename ) : #NEWLINE# #INDENT# '\n    Load a tag dictionary from a file containing one tag\n    per line.\n    ' #NEWLINE# tag_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# with open ( code , 'rb' ) as f : #NEWLINE# #INDENT# code = 0 #NEWLINE# for tag in f : #NEWLINE# #INDENT# tag = unicode ( tag , 'utf-8' ) . strip ( ) #NEWLINE# if tag : #NEWLINE# #INDENT# tag_dict [ tag ] = code #NEWLINE# code += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return tag_dict