Imperfections dans mon français To conjugate a verb in l'imparfait, one needs to perform the following steps:


Find the "stem" of the word; this is achieved by omitting the -ons from the nous-conjugated form of the word. For example, vivre is nous vivons; removing -ons from vivons yields viv-.
Take the stem and add an appropriate ending, according to the subject. Here are the endings:

je         -ais
tu         -ais
il/elle    -ait

nous       -ions
vous       -iez
ils/elles  -aient



Objective Given a verb and a subject, output the imperfect form of that verb with respect to the subject. The input format can be in any format convenient to your language. Your submission can either be a program, snippet, or function. (Note that the verb does not have to be a real verb.)

You can assume that the verb is a regular verb, i.e, items like avoir would be treated as an -ir verb, not an irregular one. The only verb you have to quantify as irregular is être; it is conjugated as such:

j'étais
tu étais
il/elle était

nous étions
vous étiez
ils/elles étaient


Here are the conjugations for -er, -re, and -ir verbs in the nous forms

-ER =&gt; (e)ons           ; e is added after a 'g'
-RE =&gt; ons
-IR =&gt; issons


Anything that does not end with such does not have to be handled.

(Note that je merges with the next vowel, if there is one. E.g., je acheter -&gt; j'achetais. h will be considered a vowel for our purposes.)

Example IOs

input: tu vivre
output: tu vivais

input: elles nager
output: elles nageaient

input: je morter
output: je mortais     ; incorrect in real life, but correct for our purposes

input: vous finir
output: vous finissiez

input: il croire
output: il croiait

input: nous jouer
output: nous jouions


Bonuses


-5N bytes for all N extra irregular verb handled.
-10% if you also output every conjugation of the verb in the imperfect tense.




This is a code-golf, so the shortest program in bytes wins.
Haskell, 366 362 352 bytes

s#v=m++g++d++t
 where
 m|v=="être"="ét"|i/="rio"&amp;&amp;i/="erd"&amp;&amp;i/="eri"=r 2 v|otherwise=r 3 v
 g=if(last m=='g'&amp;&amp;head t/='i')then"e"else""
 d|init i=="ri"="iss"|i=="eri"="y"|otherwise=""
 t|s=="je"||s=="tu"="ais"|elem s["il","elle","on"]="ait"|s=="nous"="ions"|s=="vous"="iez"|s=="ils"||s=="elles"="aient"
 r i=reverse.drop i.reverse
 i=take 3$reverse v


You can compile this in ghci and use it like so "je"#"choisir" to get "choisissais".

This code works with some irregular verbs. It can conjugate croire (je croyais, tu croyais…) or prendre as well as all its derivatives (apprendre, comprendre, etc.).

I couldn't find a short way to conjugate other verbs ending in -ire (such as lire, rire, dire, etc.) or in -dre (such as craindre, soudre, etc.).