The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lingua::EN::Conjugate - Conjugation of English verbs

SYNOPSIS

        use Lingua::EN::Conjugate qw( conjugate conjugations contraction);
        

        print conjugate( 'verb'=>'look', 
                                'tense'=>'perfect_prog', 
                                'pronoun'=>'he',
                                'negation'=>'not' );  
 
                        # "he was not looking"


        my $go = conjugate( 'verb'=>'go', 
                                'tense'=>[qw(past modal_perf)], 
                                'modal'=>'might') ; 
                                
                        # returns a hashref  
   
        print $go->{modal_perf}{I};   # "I might have gone"
                                


        my @be = conjugate( 'verb'=>'be', 
                                'pronoun'=>[qw(I we)], 
                                'tense'=>'past_prog',
                                'negation'=>'n_t' );

                        # returns an array
        print $be[0];   # "I wasn't going"


        #pretty printed table of conjugations

        print conjugations( 'verb'=>'walk', 
                                'question'=>1, 
                                'allow_contractions'=>1, 
                                'modal'=>'should', 
                                'negation'=>'n_t');
 ------------- PRESENT ------------- ---------- PRESENT_PROG -----------
 don't I walk                        am I not walking
 don't you walk                      aren't you walking
 doesn't he walk                     isn't he walking
 don't we walk                       aren't we walking
 don't they walk                     aren't they walking
 -------------- PAST --------------- ------------ PAST_PROG ------------
 didn't I walk                       wasn't I walking
 didn't you walk                     weren't you walking
 didn't he walk                      wasn't he walking
 didn't we walk                      weren't we walking
 didn't they walk                    weren't they walking
 ----------- PRESENT_DO ------------ ------------- PAST_DO -------------
 don't I walk                        didn't I walk
 don't you walk                      didn't you walk
 doesn't he walk                     didn't he walk
 don't we walk                       didn't we walk
 don't they walk                     didn't they walk
 ------------ PAST_PROG ------------ ------------- PERFECT -------------
 wasn't I walking                    haven't I walked
 weren't you walking                 haven't you walked
 wasn't he walking                   hasn't he walked
 weren't we walking                  haven't we walked
 weren't they walking                haven't they walked
 ---------- PAST_PERFECT ----------- ---------- PERFECT_PROG -----------
 hadn't I walked                     haven't I been walking
 hadn't you walked                   haven't you been walking
 hadn't he walked                    hasn't he been walking
 hadn't we walked                    haven't we been walking
 hadn't they walked                  haven't they been walking
 -------- PAST_PERFECT_PROG -------- -------------- MODAL --------------
 hadn't I been walking               shouldn't I walk
 hadn't you been walking             shouldn't you walk
 hadn't he been walking              shouldn't he walk
 hadn't we been walking              shouldn't we walk
 hadn't they been walking            shouldn't they walk
 -------------- MODAL -------------- --------- MODAL_PERF_PROG ---------
 shouldn't I walk                    shouldn't I have been walking
 shouldn't you walk                  shouldn't you have been walking
 shouldn't he walk                   shouldn't he have been walking
 shouldn't we walk                   shouldn't we have been walking
 shouldn't they walk                 shouldn't they have been walking

DESCRIPTION

This module constructs various verb tenses in English.

Thanks to Susan Jones for the list of irregular verbs and an explanation of English verb tenses http://www2.gsu.edu/~wwwesl/egw/grlists.htm.

past($infinitive)

past tense form of the verb: "go" -> "went"

participle($infinitive)

past participle form of the verb: "go" -> "gone"

gerund($infinitive)

"-ing" form of the verb: "go" -> "going"

s_form($infinitive)

third person singular form of the verb: "go" -> "goes"

conjugate('verb'=> 'go' , OPTIONS)

In scalar context with tense and pronoun defined as scalars, only one conjugation is returned.

In scalar context with tense and pronoun undefined or defined as array refs, a hashref keyed by tense and pronoun is returned.

In array context, it returns an array of conjugated forms ordered by tense, then pronoun.

verb

'verb'=>'coagulate'

The only required parameter. The verb should be in its infinitive form (no "is", "was" etc.) and without a "to" tacked on the front.

tense
 'tense'=>'past'
 'tense'=>['modal_perf', 'used_to']

If no 'tense' argument is supplied, all applicable tenses are returned.

passive
 'passive' => 1
 'passive' => undef (default)

If specified, the passive voice is used. Some tenses, such as Imperiative, are disabled when the passive option is used.

pronoun
 'pronoun'=>'he'
 'pronoun'=>[qw(I we you)]

If no 'pronoun' argument is supplied, all applicable pronouns are returned.

question
 'question' => 1
 'question' => 0  (default)

In case you're playing Jeapordy

negation
 'negation'=> 'not'
 'negation'=> 'n_t'
 'negation'=> undef  (default)

Changes "do" to "do not" or "don't" depending on which value you request. For words where you can't use "n't" (like "am") or where it feels clumsy or antique (like "may"), this will substitute "not" for "n_t" as appropriate.

 'modal' => one of: may, might, must, should, could, would, will (default), can, shall.

Specifies what modal verb to use for the modal tenses.

http://www.kyrene.k12.az.us/schools/brisas/sunda/verb/1help.htm

allow_contractions
  'allow_contractions'=>1  allows "I am"->"I'm", "they are"->"they're" and so on
  'allow_contractions'=>0  (default)

The negation rule above is applied before the allow_contractions rule is checked:

        allow_contractions =>1, negation=>n_t : "he isn't walking"; 
        allow_contractions =>0, negation=>n_t : "he isn't walking";
        allow_contractions =>1, negation=>not : "he's not walking";
        allow_contractions =>0, negation=>not " "he is not walking";
conjugations()
   returns a pretty-printed table of conjugations.  (code stolen from L<Lingua::IT::Conjugate>)

EXPORT

None by default. You can export the following functions and variables:

        conjugate
        conjugations
        past
        participle
        gerund
        s_form
        @tenses
        @pronouns

BUGS

TODO

 HAVE TO + Verb
 HAVE GOT TO + Verb
 BE ABLE TO + Verb
 OUGHT TO + Verb
 BE SUPPOSED TO + Verb

AUTHOR

Russ Graham, russgraham@gmail.com

SEE ALSO