Idea of this problem was suggested by our colleague qwerty_one - thanks a lot!
We have a list of phrases in some Unknown Language (pretending to be natural) - and their translations to English. E.g.:
bialy chleb - white bread
charny chleb - black bread
All we need is to "learn" that language - or rather find the meaning of every word - and to translate some more phrases from English to that Unknown Language again.
Input Data contain a list of phrases with translations (separated with dash "-"
).
Then single line with English phrases without translations follows (separated with semicolons ";"
).
Answer should give the same last line translated (here order of words should be kept and semicolons too).
Example:
input data:
bialy pies - white dog
czarny kotek - black kitten
czarny dlugopis - black pen
czerwony samochod - red car
szybki samochod - fast car
szybki pies - fast dog
fast kitten; black car; red pen
answer:
szybki kotek; czarny samochod; czerwony dlugopis