question_list.append(qIDList[i])
        for j in range(0, len(qWords)):
            if qWords[j].lower() == 'who' or qWords[j].lower(
            ) == 'whom' or qWords[j].lower() == 'whose':
                q_flag = 1
                result = who.answering_who(
                    cleansedqList[i], stopwords_free_questions_list[i],
                    sentences_list, stopwords_free_sentences_list,
                    master_person_list,
                    master_prof_list)  #stopwords_free_sentences_list
                break
            elif qWords[j].lower() == 'what':
                q_flag = 1
                result = what.answering_what(
                    cleansedqList[i], stopwords_free_questions_list[i],
                    sentences_list, stopwords_free_sentences_list,
                    master_time_list,
                    master_person_list)  #stopwords_free_sentences_list
                break
            elif qWords[j].lower() == 'when':
                q_flag = 1
                result = when.answering_when(
                    cleansedqList[i], stopwords_free_questions_list[i],
                    sentences_list, stopwords_free_sentences_list, hline_date,
                    master_month_list,
                    master_time_list)  #stopwords_free_sentences_list

                break
            elif qWords[j].lower() == 'where':
                q_flag = 1
                result = where.answering_where(

    for i in range(0, len(cleansedqList)):
        result=""
        qWords= cleansedqList[i].split()
        print qIDList[i]
        q_flag=0
        question_list.append(qIDList[i])
        for j in range(0, len(qWords)):
            if qWords[j].lower()=='who' or qWords[j].lower()=='whom' or qWords[j].lower()=='whose'  :
                q_flag=1
                result=who.answering_who(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,master_person_list,master_prof_list) #stopwords_free_sentences_list
                break
            elif qWords[j].lower()=='what':
                q_flag=1
                result=what.answering_what(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,master_time_list,master_person_list) #stopwords_free_sentences_list
                break
            elif qWords[j].lower()=='when':
                q_flag=1
                result=when.answering_when(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date,master_month_list,master_time_list) #stopwords_free_sentences_list

                break
            elif qWords[j].lower()=='where':
                q_flag=1
                result=where.answering_where(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date,master_loc_list) #stopwords_free_sentences_list

                break
            elif qWords[j].lower()=='why':
                q_flag=1
                result=why.answering_why(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list) #stopwords_free_sentences_list
Пример #3
0
            if qWords[j].lower() == 'who':
                #print 'Who question',cleansedqList[i]
                q_flag = 1
                answer_list.append(
                    who.answering_who(cleansedqList[i],
                                      stopwords_free_questions_list[i],
                                      stopwords_free_sentences_list)
                )  #stopwords_free_sentences_list
                #result=who.answering_who(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list) #stopwords_free_sentences_list
                break
            elif qWords[j].lower() == 'what':
                #what_list.append(cleansedqList[i])
                q_flag = 1
                answer_list.append(
                    what.answering_what(
                        cleansedqList[i], stopwords_free_questions_list[i],
                        sentences_list, stopwords_free_sentences_list,
                        hline_date))  #stopwords_free_sentences_list
                #result=what.answering_what(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list

                break
            elif qWords[j].lower() == 'when':
                #who_list.append(cleansedqList[i])
                q_flag = 1
                answer_list.append(
                    when.answering_when(
                        cleansedqList[i], stopwords_free_questions_list[i],
                        stopwords_free_sentences_list,
                        hline_date))  #stopwords_free_sentences_list
                #result=when.answering_when(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list

                break
    for i in range(0, len(cleansedqList)):
        qWords= cleansedqList[i].split()
        print qIDList[i]
        q_flag=0
        question_list.append(qIDList[i])
        for j in range(0, len(qWords)):
            if qWords[j].lower()=='who':
                #print 'Who question',cleansedqList[i]
                q_flag=1
                answer_list.append(who.answering_who(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list)) #stopwords_free_sentences_list
                #result=who.answering_who(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list) #stopwords_free_sentences_list
                break
            elif qWords[j].lower()=='what':
                #what_list.append(cleansedqList[i])
                q_flag=1
                answer_list.append(what.answering_what(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date)) #stopwords_free_sentences_list
                #result=what.answering_what(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list

                break
            elif qWords[j].lower()=='when':
                #who_list.append(cleansedqList[i])
                q_flag=1
                answer_list.append(when.answering_when(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list,hline_date)) #stopwords_free_sentences_list
                #result=when.answering_when(cleansedqList[i],stopwords_free_questions_list[i],stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list

                break
            elif qWords[j].lower()=='where':
                #where_list.append(cleansedqList[i])
                q_flag=1
                answer_list.append(where.answering_where(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date)) #stopwords_free_sentences_list
                #result=where.answering_where(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list