Subject: ANNOUNCE: Lingua::PT::Conjugate
From: [email-masked] (Etienne Grossmann)
Date: 11 Feb 1998 22:49:36 GMT
Newsgroups: comp.lang.perl.announce,comp.lang.perl.modules

Hello,

  the module Lingua::PT::Conjugate is not just for programmers, as it
also contains shell-callable program-lets, one of which is meant to
train the user at conjugating Portuguese verbs :

  The program   treinar  chooses (you may choose it too) a verb, and
asks you to conjugate it. If you fail, it will put it that verb in a
file ~/.flunked.verbs and will probably ask you about that verb later
on, until you learn it (it will then delete the verb from the file). 

  Typical output : (sorry, there are iso-8859-1 characters. they can
be toggled off)

######################################################################
> treinar difundir cimp

           A DRILLING PROGRAM FOR PORTUGUESE VERBS                   
---------------------------------------------------------------------
 INPUT:                       COMMANDS:                              
 q                            Quit                                   
 h                            Print help                             
 <verb>                       Enter the requested verb               
 c [eu|tu...|1..6] <verb>     Correct a previous entry 
 f [tense]                    Fix drilled tense (default : current)
 i                            Toggle iso 8859-1 accentuation
 t [verb] [tense]             Will drill next  on "verb" at "tense"  
                              (default : same)                       
                                                                     
           A ACENTUA\C~AO E A CEDILHA FAZEM-SE ASSIM.                
---------------------------------------------------------------------

           difundir            Conjuntivo  Imperfeito         

        eu difundisse          OK 
        tu difundisses         OK 
   ele/ela difundisse          OK 
       n�ós difund�íssemos       OK 
 eles/elas difundisem          Nope : difundissem

Appending to .flunked_verbs

           cobrir              Conjuntivo Presente            

        eu q

           Adeusinho 

######################################################################

  Not high-tech looks, but it seems to work ok. Bug reports are
welcome and awaited, as well as advice and relevant opinions.	

  On the programming side,

use Lingua::PT::Conjugate ;    

  puts in your namespace a function "conjug" ;

$verb  = "dormir";  # The verb is "to sleep"
$tense = "pres"  ;  # The tense is "present". It could have been :

        # "perf"  for "perfeito"              (I slept)
        # "imp"   for "imperfeito"            (I was sleeping) 
        # "fut"   for "futuro"                (I will sleep)
        # "mdp"   for "mais-que-perfeito"     (I had slept)
        # "cpres" for "conjuntivo presente"   (that I sleep)
        # "cimp"  for "conjuntivo imperfeito" (that you were sleeping)
        # "cfut"  for "conjuntivo futuro"     (when I will sleep)
        # "cond"  for "condicional"           (I would sleep)
        # "ivo"   for "imperativo"            (sleep!)
        # "pp"    for "participio passado"    (slept)
        # "grd"   for "gerundivo"             (sleeping)

$a = conjug("$verb","$tense");

   assigns to $a the string : 
<<EOS
dormir :  irreg                              
pres      durmo dormes dorme dormimos dormem 
EOS

  in order to only get the verbal forms, and only for the 3rd person
singular :

$a = conjug("q","dormir","pres",3);

  yields :

<<EOS
dorme
EOS	

	The heading parameter "q" is an option for "quiet". There are
        others, described in the man pages.

        There is a shell wrapper called "conjug" , that takes the same
        options as the function :

######################################################################	
> conjug dormir
dormir :  irreg                                             
pres      durmo    dormes    dorme    dormimos    dormem    
perf      dormi    dormiste  dormiu   dormimos    dormiram  
imp       dormia   dormias   dormia   dorm�íamos   dormiam   
fut       dormirei dormir�ás  dormir�á  dormiremos  dormir�ão  
mdp       dormira  dormiras  dormira  dorm�íramos  dormiram  
cpres     durma    durmas    durma    durmamos    durmam    
cimp      dormisse dormisses dormisse dorm�íssemos dormissem 
cfut      dormir   dormires  dormir   dormirmos   dormirem  
cond      dormiria dormirias dormiria dormir�íamos dormiriam 
ivo                dorme     dorma    dormamos    dormam    
pp        dormido                                           
grd       dormindo                      
######################################################################	

	that's about it,

	Etienne

ps  : Thanks to all on usenet and here in Lisbon who helped with
advice, tips etc. 

pps : Maybe in a few months, a module that un-conjugates (takes in a
word, and tells me if it could be a verb, and if yes, at what tenses
and persons). Maybe.