示例#1
0
def parse_question_and_answer(text_list):
    question = ""
    start = 0
    for i, keyword in enumerate(text_list):
        question += keyword
        if "?" in keyword:
            start = i + 1
            break
    real_question = question.split(".")[-1]
    question, true_flag = parse_false(real_question)
    return true_flag, real_question, question, text_list[start:]
示例#2
0
def parse_question_and_answer(title, answers):
    # question = ""
    # start = 0
    # for i, keyword in enumerate(text_list):
    #     question += keyword
    #     if "?" in keyword:
    #         start = i + 1
    #         break
    real_question = title.split(".")[-1]
    question, true_flag = parse_false(real_question)
    return true_flag, real_question, question, answers
示例#3
0
def parse_question_and_answer(text_list):
    question = ""
    start = 0
    for i, keyword in enumerate(text_list):
        question += keyword
        if "?" in keyword:
            start = i + 1
            break
    print(100)
    question = question.split(".")[-1]
    print(1112)
    question, true_flag = parse_false(question)
    print(222)
    return true_flag, question, text_list[start:]
示例#4
0
def parse_question_and_answer(text_list):
    question = ""
    start = 0
    for i, keyword in enumerate(text_list):
        question += keyword
        if "?" in keyword:
            start = i + 1
            break
    real_question = question.split(".")[-1]

    for char, repl in [("以下", ""), ("下列", "")]:
        real_question = real_question.replace(char, repl, 1)

    question, true_flag = parse_false(real_question)
    return true_flag, real_question, question, text_list[start:]
示例#5
0
def parse_question_and_answer(text_list):
    question = ""
    start = 0
    for i, keyword in enumerate(text_list):
        question += keyword
        if "?" in keyword:
            start = i + 1
            break
    real_question = question.split(".")[-1]

    for char, repl in [("以下", ""), ("下列", "")]:
        real_question = real_question.replace(char, repl, 1)

    question, true_flag = parse_false(real_question)
    return true_flag, real_question, question, text_list[start:]