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

                break
            elif qWords[j].lower() == 'how':
                q_flag = 1
                result = how.answering_how(
                    cleansedqList[i], stopwords_free_questions_list[i],
                    sentences_list, stopwords_free_sentences_list,
                    master_time_list,
                    master_percent_list)  #stopwords_free_sentences_list
                break
            elif qWords[j].lower() == 'which':
                q_flag = 1
                result = which.answering_which(
                    cleansedqList[i], stopwords_free_questions_list[i],
                    sentences_list, stopwords_free_sentences_list)
                break
            else:
                answer_list.append('No answer')
                #print 'Answer:  No answer'+'\n'
        '''if result=="" and q_flag == 0:
            print 'Answer: No answer'+'\n'
        if result=="" and q_flag !=0:
                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

                break
            elif qWords[j].lower()=='how':
                q_flag=1
                result=how.answering_how(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,master_time_list,master_percent_list) #stopwords_free_sentences_list
                break
            elif qWords[j].lower()=='which':
                q_flag=1
                result=which.answering_which(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list)
                break
            else:
                answer_list.append('No answer')
                #print 'Answer:  No answer'+'\n'
        '''if result=="" and q_flag == 0:
            print 'Answer: No answer'+'\n'
        if result=="" and q_flag !=0:
            print 'Answer: No answer'+'\n'''
        if q_flag==0:
            print 'Answer: No answer'+'\n'
        else:
Beispiel #3
0
                #why_list.append(cleansedqList[i])
                q_flag = 1
                answer_list.append(
                    why.answering_why(
                        cleansedqList[i], stopwords_free_questions_list[i],
                        sentences_list, stopwords_free_sentences_list,
                        hline_date))  #stopwords_free_sentences_list
                #result=why.answering_why(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list

                break
            elif qWords[j].lower() == 'how':
                #how_list.append(cleansedqList[i])
                q_flag = 1
                answer_list.append(
                    how.answering_how(
                        cleansedqList[i], stopwords_free_questions_list[i],
                        sentences_list, stopwords_free_sentences_list,
                        hline_date))  #stopwords_free_sentences_list
                #result=how.answering_how(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list
                break
            else:
                answer_list.append('No answer')
                #print 'Answer:  No answer'+'\n'
        if q_flag == 0:
            print 'Answer: No answer' + '\n'
    '''print 'Questions belonging to who list:', who_list
    print 'Questions belonging to what list:', what_list
    print 'Questions belonging to when list:', when_list
    print 'Questions belonging to where list:', where_list
    print 'Questions belonging to why_list:', why_list
    print 'Questions belonging to how list:', how_list'''
                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

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

                break
            elif qWords[j].lower()=='how':
                #how_list.append(cleansedqList[i])
                q_flag=1
                answer_list.append(how.answering_how(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date)) #stopwords_free_sentences_list
                #result=how.answering_how(cleansedqList[i],stopwords_free_questions_list[i],sentences_list,stopwords_free_sentences_list,hline_date) #stopwords_free_sentences_list
                break
            else:
                answer_list.append('No answer')
                #print 'Answer:  No answer'+'\n'
        if q_flag == 0:
            print 'Answer: No answer'+'\n'


    '''print 'Questions belonging to who list:', who_list
    print 'Questions belonging to what list:', what_list
    print 'Questions belonging to when list:', when_list
    print 'Questions belonging to where list:', where_list
    print 'Questions belonging to why_list:', why_list
    print 'Questions belonging to how list:', how_list'''