from encodeFileToJson import ProcessFile

if __name__ == "__main__":
    question_type = 51
    index = 4
    parent_path = "/home/lyh/java/eclipse-workspace/QuestionGeneration/src/data/pigment/"
    input_filename = "PigmentProblem.txt"
    keyword_filename = "Pigment.txt"
    keyword_file = parent_path + keyword_filename
    input_file = parent_path + input_filename
    output_file = "../data/pigmentProblemJson.json"
    keywords = ProcessFile().get_keyword(keyword_file,
                                         index=1,
                                         is_question=False)
    ProcessFile().topfuction(input_file,
                             output_file,
                             question_type,
                             index,
                             keywords=keywords)
from encodeFileToJson import ProcessFile

if __name__=="__main__":
    question_type=31
    index=2
    parent_path="/home/lyh/java/eclipse-workspace/QuestionGeneration/src/data/raw_output/whats/"
    input_filename = "problem.txt"
    output_file="../data/rawoutputOfWhatsProblemJson.json"
    keyword_filename = "raw_output.txt"
    keyword_file = parent_path+keyword_filename
    input_file = parent_path + input_filename
    keywords = ProcessFile().get_keyword(keyword_file,index=3,is_question=True,delimiter=",")
    ProcessFile().topfuction(input_file,output_file,question_type,index,keywords=keywords)


from encodeFileToJson import ProcessFile

if __name__ == "__main__":
    question_type = 21
    index = 2
    parent_path = "/home/lyh/java/eclipse-workspace/QuestionGeneration/src/data/output/"
    input_filename = "problem.txt"
    keyword_filename = "output.txt"
    keyword_file = parent_path + keyword_filename
    input_file = parent_path + input_filename
    output_file = "../data/outputProblemJson.json"
    keywords = ProcessFile().get_keyword(keyword_file, index=2, delimiter=',')
    ProcessFile().topfuction(input_file,
                             output_file,
                             question_type,
                             index,
                             keywords=keywords)
"""
由于experiment题中
问题与答案行数相差不是固定值,所以手动修改下
生成的json文件
"""
from encodeFileToJson import ProcessFile

if __name__ == "__main__":
    question_type = 61
    index = 6
    parent_path = "/home/lyh/java/eclipse-workspace/QuestionGeneration/src/data/experiment/"
    input_filename = "Problem.txt"
    keyword_filename = "experiment.txt"
    input_file = parent_path + input_filename
    output_file = "../data/experimentProblemJson.json"
    ProcessFile().topfuction(input_file, output_file, question_type, index)
from encodeFileToJson import ProcessFile

if __name__ == "__main__":
    question_type = 32
    index = 2
    parent_path = "/home/lyh/java/eclipse-workspace/QuestionGeneration/src/data/raw_output/function/"
    input_filename = "FunctionProblem.txt"
    output_file = "../data/rawoutputOfFunctionProblemJson.json"
    input_file = parent_path + input_filename
    keywords = ["原料"]
    ProcessFile().topfuction(input_file,
                             output_file,
                             question_type,
                             index,
                             keywords=keywords)