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 yieldsviv-
. 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 => (e)ons ; e is added after a 'g'
-RE => ons
-IR => 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 -> 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.
je habiter
becomej' habite
orj'habite
? \$\endgroup\$Morter
doesn't exist, I assume you are referring toto die
which ismourir
, which would yieldje mourais
which is actually correct. \$\endgroup\$morter
. It's technically incorrect because its not a word. \$\endgroup\$