I'm trying to create a program that takes an input and then converts it from an Australian Aboriginal language into English. While the rest of the program is functional, the output is printed in the wrong format. The output that I'm receiving is:
ngaju
kuja-piya
malilyi
What I want to receive is:
ngaju kuja-piya malilyi
Here is my full code:
dictionary = open('dictionary.txt')
words = {}
for line in dictionary:
english, aboriginal = line.split(',')
words[english] = aboriginal
translator = input("English: ")
while translator:
sentence = translator.split()
for word in sentence:
print(words[word], end='')
translator = input("English: ")
And here are the contents of dictionary.txt:
afternoon,wuraji-wuraji
I,ngaju
bird,jirripirdi
like,kuja-piya
dance,juka-pinyi
python,malilyi
laugh,ngarlarrimi
we,ngalipa