I have two strings in two different lists A = [dog bit dog null] and B = [hund bet hund].
I would like to find all possible allignments from list B to list A such as :
C = [(hund = dog, bet = bit, hund = dog),
(hund = dog, bet = bit, hund = bit),
(hund = dog, bet = bit, hund = null),
(hund = dog, bet = dog, hund = dog),
(hund = dog, bet = dog, hund = bit),
etc.. ]
I think there are 64 different allignments between these two strings.
I am working on the IBM model1 for word translastion.
If you want the 64 possibilities, you could use
itertools.product:but note that this is going to generate a fair number of duplicates, given that you have
dogtwice inA:You could even get the associated triplets of pairs if you wanted: