#!/usr/bin/python3

import sys
from helper import *

article_path = sys.argv[1]
questions_path = sys.argv[2]

article = read_article(article_path)

qna, postags = parse_qna(1)

questions = []
with open(questions_path) as f:
    for line in f:
        questions.append(line.strip())

for question in questions:
    most_similar_question, dataset_answer = get_most_similar_question(question, qna, postags)
    best_answer = get_best_answer(most_similar_question, dataset_answer, article, postags)

    print(best_answer)
