#NEWLINE# def __init__( self , lex_file , align_model = None , src_file = None , tg_file = None , tmp_dir = None ) : #NEWLINE# #INDENT# tmp_dir = mk_tmp_dir ( tmp_dir ) #NEWLINE# if ( align_model is None ) : #NEWLINE# #INDENT# if ( ( src_file is not None ) and ( tg_file is not None ) ) : #NEWLINE# #INDENT# self . align_model = train_alignments ( src_file , tg_file , tmp_dir , align_model = align_model ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Alignment model not defined, no files for training' ) #NEWLINE# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . align_model = align_model #NEWLINE# #UNINDENT# self . lex_prob = self . get_align_prob ( lex_file )