challenging-america-word-ga.../run.py

20 lines
562 B
Python
Raw Normal View History

2023-03-29 12:28:54 +02:00
#!/usr/bin/python3
import sys
for line in sys.stdin:
line = line.split('\t')
prev_word = line[6].split()[-1].replace('\\n', '')
next_word = line[7].split()[-1].replace('\\n', '')
if prev_word in ['he', 'she', 'it']:
print('is:0.6 was:0.3 :0.1')
elif prev_word == 'I':
print('am:0.6 was:0.3 :0.1')
elif prev_word == 'you':
print('are:0.6 were:0.3 :0.1')
elif prev_word == '.':
print('The:0.9 :0.1')
elif prev_word == 'The':
print('a:0.9 :0.1')
else:
print('the:0.5 a:0.4 :0.1')