#NEWLINE# def get_alignments( self , src , tg , align_model ) : #NEWLINE# #INDENT# alignments = [ [ [ ] for j in range ( len ( tg [ i ] ) ) ] for i in range ( len ( tg ) ) ] #NEWLINE# aligner = Aligner ( ( align_model + '.fwd_params' ) , ( align_model + '.fwd_err' ) , ( align_model + '.rev_params' ) , ( align_model + '.rev_err' ) ) #NEWLINE# for ( idx , ( src_list , tg_list ) ) in enumerate ( zip ( src , tg ) ) : #NEWLINE# #INDENT# align_string = aligner . align ( ( ( ' ' . join ( src_list ) + ' ||| ' ) + ' ' . join ( tg_list ) ) ) #NEWLINE# pairs = align_string . split ( ) #NEWLINE# for p_str in pairs : #NEWLINE# #INDENT# p = p_str . split ( '-' ) #NEWLINE# alignments [ idx ] [ int ( p [ 1 ] ) ] . append ( int ( p [ 0 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# aligner . close ( ) #NEWLINE# return alignments