Imperfections dans mon français

Haskell, 366 362 352 bytes

s#v=m++g++d++t
 where
 m|v=="être"="ét"|i/="rio"&&i/="erd"&&i/="eri"=r 2 v|otherwise=r 3 v
 g=if(last m=='g'&&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.).


Java, 389 385 383 382 352.7 443-10%(bonus) = 398.7 bytes

Byte count reduced thanks to @PeterTaylor and @Fatalize
Please note that my program conjugates the verb for all the pronouns, so that is how I got the 10% bonus.

class A{public static void main(String[]a){String[]e={"ais","ais","ait","ait","ions","iez","aient","aient"},p={"je","tu","il","elle","nous","vous","ils","elles"},w=new java.util.Scanner(System.in).nextLine().split(" ");if("aehiou".contains(w[1].charAt(0)+""))p[0]="j'";for(String i:p)System.out.println(i+" "+w[1].substring(0,w[1].length()-2)+(w[1].endsWith("ger")?"e":w[1].endsWith("ir")?"iss":"")+e[java.util.Arrays.asList(p).indexOf(i)]);}}

Readable form (still quite messy):

 1| class A{
 2|   public static void main(String[]a){
 3|     String[]e={"ais","ais","ait","ait","ions","iez","aient","aient"};
 4|     String[]p={"je","tu","il","elle","nous","vous","ils","elles"};
 5|     String[]w=new java.util.Scanner(System.in).nextLine().split(" ");
 6|     if("aehiou".contains(w[1].charAt(0)+""))p[0]="j'";
 7|     for(String i: p) {
 8|       System.out.print(i+" "+w[1].substring(0,w[1].length()-2)+(w[1].endsWith("ger")?"e":w[1].endsWith("ir")?"iss":"")+e[java.util.Arrays.asList(p).indexOf(i)]);
 9|     }
10|   }
11| }

Explanation:

Lines 3-4: Initialisation of arrays.
Line    5: Read a line as input and split it into words
Line    6: Shorten the `je` to `j'` in presence of a succeeding vowel or a `h`.
Line    7: Create a for-loop iterating through all of the pronouns .
Line    8: Conjugate the verb(remove the ending from the infinite form of the verb and add ending accordingly) and print the result, along with the pronoun.



(Old Version) 393-10% = 352.7 bytes

Please note also that my old program does not obey with the new rule about the je merging into j'.

class A{public static void main(String[]a){String[]e={"ais","ais","ait","ait","ions","iez","aient","aient"},p={"je","tu","il","elle","nous","vous","ils","elles"},w=new java.util.Scanner(System.in).nextLine().split(" ");for(String i:p)System.out.println(i+" "+w[1].substring(0,w[1].length()-2)+(w[1].endsWith("ger")?"e":w[1].endsWith("ir")?"iss":"")+e[java.util.Arrays.asList(p).indexOf(i)]);}}

Processing, 342-10%(bonus) = 307.8

I have created a function. To call the function, include the pronoun as the first parameter and the verb as the second. For example, a("je","habiter")

Please note that my program conjugates the verb for all the pronouns, so that is how I got the 10% bonus.

void a(String a,String b){String[]e={"ais","ais","ait","ait","ions","iez","aient","aient"},p={"je","tu","il","elle","nous","vous","ils","elles"};if("aehiou".contains(b.charAt(0)+""))p[0]="j'";for(String i:p)println(i+" "+b.substring(0,b.length()-2)+(b.endsWith("ger")?"e":b.endsWith("ir")?"iss":"")+e[java.util.Arrays.asList(p).indexOf(i)]);}

Readable form:

void a(String a,String b){
  String[]e={"ais","ais","ait","ait","ions","iez","aient","aient"},p={"je","tu","il","elle","nous","vous","ils","elles"};
  if("aehiou".contains(b.charAt(0)+""))p[0]="j'";
  for(String i:p)
    println(i+" "+b.substring(0,b.length()-2)+(b.endsWith("ger")?"e":b.endsWith("ir")?"iss":"")+e[java.util.Arrays.asList(p).indexOf(i)]);
}

Output (for a("je", "habiter"))

j' habitais
tu habitais
il habitait
elle habitait
nous habitions
vous habitiez
ils habitaient
elles habitaient