Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
returns the time of conjugation of the verb in a statement         
We have to know the list of adverbs before the verb                              
Input=sentence and the adverb bound to the verb           Output=tense           

        def find_tense_statement(phrase):
    """
    returns the time of conjugation of the verb in a statement         
    We have to know the list of adverbs before the verb                              
    Input=sentence and the adverb bound to the verb           Output=tense           
    """

    #processing for the simple past
    if phrase[0].endswith('ed') and phrase[0] != 'need':
        return 'past simple'

    #processing for the future simple
    if phrase[0] == 'will':
        return 'future simple'

    #processing for the present perfect
    if phrase[0] == 'have' or phrase[0] == 'has':
        #For regular forms
        if phrase[1].endswith('ed'):
            return 'present perfect'
            #For irregular forms
        for i in ResourcePool().irregular_verbs_past:
            if phrase[1] == i[2]:
                return 'present perfect'

    #processing for the past perfect
    if phrase[0] == 'had':
        #For regular forms
        if phrase[1].endswith('ed'):
            return 'past perfect'
            #For irregular forms
        for i in ResourcePool().irregular_verbs_past:
            if phrase[1] == i[2]:
                return 'past perfect'

    #processing for the progressive form and passive form (in present)
    if phrase[0] == 'is' or phrase[0] == 'are' or phrase[0] == 'am' or phrase[0] == 'be':
        #Progressive form in the present
        if len(phrase) != 1 and phrase[1].endswith('ing') and not (phrase[1].endswith('thing')):
            return 'present progressive'
        #Passive form in the present
        elif find_tense_statement(['have'] + phrase[1:]) == 'present perfect':
            #If there is an adjective and not a verb
            if phrase[1] in ResourcePool().adjective_verb:
                return 'present simple'
            return 'present passive'

    #processing for the progressive form and passive form (in past)
    if phrase[0] == 'was' or phrase[0] == 'were':
        #Progressive form in the past
        if len(phrase) != 1 and phrase[1].endswith('ing') and not (phrase[1].endswith('thing')):
            return 'past progressive'
        elif find_tense_statement(['have'] + phrase[1:]) == 'present perfect':
            #If there is an adjective and not a verb
            if phrase[1] in ResourcePool().adjective_verb:
                return 'past simple'
            return 'past passive'

    #For using modal
    elif phrase[0] == 'should' or phrase[0] == 'might' or phrase[0] == 'could':
        if find_tense_statement(phrase[1:]) == 'present perfect' or find_tense_statement(
                phrase[1:]) == 'present passive':
            return 'passive conditional'
        return 'present conditional'

    #processing for the conditional form
    if phrase[0] == 'would':
        if find_tense_statement(phrase[1:]) == 'present passive':
            return 'passive conditional'
        elif find_tense_statement(phrase[1:]) == 'present simple':
            return 'present conditional'
        else:
            return 'past conditional'

    #For the irregular forms
    for i in ResourcePool().irregular_verbs_past:
        if phrase[0] == i[1]:
            #Default case : if past form = present form we choose present simple
            if i[1] == i[0]:
                return 'present simple'
            else:
                return 'past simple'

    #Default case
    return 'present simple'
        


src/d/i/Dialogs-0.13/src/dialogs/parsing/analyse_sentence.py   Dialogs(Download)
    #If there is one element => it is an auxiliary => verb 'be'
    if len(sentence) == 0:
        vg.vrb_tense = analyse_verb.find_tense_statement(aux)
        vg.vrb_main = ['be']
    else:
            #Before the negative form we have an auxiliary for the negation
            if sentence[0] == 'do' or sentence[0] == 'does' or sentence[0] == 'did':
                vg.vrb_tense = analyse_verb.find_tense_statement([sentence[0]])
                sentence = sentence[2:]
                sentence = analyse_verbal_structure.delete_unusable_word(sentence)
                sentence = analyse_verbal_structure.delete_unusable_word(sentence)
                sentence = analyse_verbal_structure.find_vrb_adv(sentence, vg)
                vg.vrb_tense = analyse_verb.find_tense_statement(sentence)
 
            else:
                #We remove 'not' and find the tense
                sentence = sentence[:1] + sentence[2:]
                sentence = analyse_verbal_structure.delete_unusable_word(sentence)
                sentence = analyse_verbal_structure.find_vrb_adv(sentence, vg)
                vg.vrb_tense = analyse_verb.find_tense_statement(sentence)
            sentence = analyse_verbal_structure.delete_unusable_word(sentence)
            sentence = analyse_verbal_structure.find_vrb_adv(sentence, vg)
            vg.vrb_tense = analyse_verb.find_tense_statement(sentence)
 
        verb = analyse_verb.find_verb_statement(sentence, vg.vrb_tense)