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

20 lines
650 B
Python

#!/usr/bin/python3
import sys
for line in sys.stdin:
spitted_line = line.split('\t')
left_context = spitted_line[6]
right_context = spitted_line[7]
left_context_words = left_context.split(' ')
right_context_words = right_context.split(' ')
# print(left_context_words)
# print()
# print(right_context_words)
if left_context_words[-1] == 'At' or left_context_words[-1] == 'at':
print('first:0.6 which:0.3 :01')
elif left_context_words[-1] == 'the':
print('it:0.5 a:0.4 :01')
elif left_context_words[-1] == 'a':
print('the:0.7 it:0.2 :01')
else:
print('the:0.6 a:0.3 :01')