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
-onsfrom the nous-conjugated form of the word. For example, vivre is nous vivons; removing
-onsfrom vivons yields
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
-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.)
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
- -5N bytes for all
Nextra 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.