This is a simple example of what I am trying to do.
Say, I have a random list which is the following:
aa = 1
b = 2
c = 3
ao = 4
uw = 5
d = 6
ih = 7
I give the input to the program as:
b d aa aw ay c
In the input there are strings which don’t have values and are not present in the list like ‘aw’ and ‘ay’. So, I have to change them into the strings which are present in the list. But the problem is, ‘aw’ and ‘ay’ are the combination of two strings. For example, I have to change ‘aw’ as ao + uw and ‘ay’ as ao + ih and form a list. So the new list of the input should be like,
b
d
aa
ao
uw
ao
ih
c
And the final output should be their corresponding values which is,
2 6 1 4 5 4 7 3
I could not write this in code. Could someone help please? Thank you.
How about …