コード例 #1
0
def w_quest_how(type, sentence):
    """
    process many different type of how question                         
    Input=type of sentence, the sentence      Output=class Sentence                  
    """

    aux_list = other_functions.recover_aux_list()
    if sentence[1] in aux_list:
        analysis = y_n_ques(type, 'manner', sentence[1:])

        #The case when we have 'do' + ing form
        if analysis.sv[0].vrb_main[0].endswith('like'):
            analysis.aim = 'opinion'
        return analysis

    analysis = y_n_ques(type, sentence[1], sentence[2:])
    return analysis
コード例 #2
0
ファイル: analyse_sentence.py プロジェクト: pcannon67/dialogs
def w_quest_how(type, sentence):
    """
    process many different type of how question                         
    Input=type of sentence, the sentence      Output=class Sentence                  
    """

    aux_list = other_functions.recover_aux_list()
    if sentence[1] in aux_list:
        analysis = y_n_ques(type, 'manner', sentence[1:])

        #The case when we have 'do' + ing form
        if analysis.sv[0].vrb_main[0].endswith('like'):
            analysis.aim = 'opinion'
        return analysis

    analysis = y_n_ques(type, sentence[1], sentence[2:])
    return analysis
コード例 #3
0
ファイル: analyse_sentence.py プロジェクト: pcannon67/dialogs
def w_quest_what(type, sentence):
    """
    process many different type of what question                        
    Input=type of sentence, the sentence and position of subject                      
    Output=class Sentence                                                            
    """

    aux_list = other_functions.recover_aux_list()
    if sentence[1] in aux_list:

        #We start with a processing with the function of y_n_question's case
        analysis = y_n_ques(type, 'thing', sentence[1:])

        vg = analysis.sv[0]
        #The case when we have 'happen'
        if analysis.sv[0].vrb_main[0].endswith('happen'):
            analysis.aim = 'situation'

        #The case when we have 'think'
        elif analysis.sv[0].vrb_main[0].endswith('think+of') or analysis.sv[
                0].vrb_main[0].endswith('think+about'):
            analysis.aim = 'opinion'

        #The case when we have 'like' + conditional
        elif analysis.sv[0].vrb_main[0].endswith('like') and not (
                analysis.sv[0].vrb_tense.endswith('conditional')):
            analysis.aim = 'description'

        #The case when we have 'do' + ing form
        elif vg.vrb_main[0].endswith('do') and \
                        vg.i_cmpl != [] and \
                        vg.i_cmpl[0].gn[0].adj != [] and \
                        vg.i_cmpl[0].gn[0].adj[0][0].endswith('ing'):
            analysis.aim = 'explication'

    #There is a noun before the auxiliary
    else:
        #We will use the same code as the which questions
        sentence = ['the'] + sentence[1:]
        #We need to have a nominal group at the beginning
        analysis = w_quest_which(type, 'thing', sentence)
    return analysis
コード例 #4
0
def w_quest_what(type, sentence):
    """
    process many different type of what question                        
    Input=type of sentence, the sentence and position of subject                      
    Output=class Sentence                                                            
    """

    aux_list = other_functions.recover_aux_list()
    if sentence[1] in aux_list:

        #We start with a processing with the function of y_n_question's case
        analysis = y_n_ques(type, 'thing', sentence[1:])

        vg = analysis.sv[0]
        #The case when we have 'happen'
        if analysis.sv[0].vrb_main[0].endswith('happen'):
            analysis.aim = 'situation'

        #The case when we have 'think'
        elif analysis.sv[0].vrb_main[0].endswith('think+of') or analysis.sv[0].vrb_main[0].endswith('think+about'):
            analysis.aim = 'opinion'

        #The case when we have 'like' + conditional
        elif analysis.sv[0].vrb_main[0].endswith('like') and not (analysis.sv[0].vrb_tense.endswith('conditional')):
            analysis.aim = 'description'

        #The case when we have 'do' + ing form
        elif vg.vrb_main[0].endswith('do') and \
                        vg.i_cmpl != [] and \
                        vg.i_cmpl[0].gn[0].adj != [] and \
                        vg.i_cmpl[0].gn[0].adj[0][0].endswith('ing'):
            analysis.aim = 'explication'

    #There is a noun before the auxiliary
    else:
        #We will use the same code as the which questions
        sentence = ['the'] + sentence[1:]
        #We need to have a nominal group at the beginning
        analysis = w_quest_which(type, 'thing', sentence)
    return analysis