
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 1.12 KB | hits: 14 | expires: Never
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
ail = 'bail corail émail fermail soupirail travail vantail vitrail'.split()
al = 'final cheval journal tropical canal'.split()
au = 'landau sarrau'.split()
eau = 'eau seau cadeau rideau beau oiseau corbeau'.split()
eu = 'pneu bleu emeu'.split()
ou = 'bijou hibou chou genou caillou pou ripou '.split()
def pluriel(mot):
mot = mot.lower() #choix de returner les mots en minuscule
if mot[-1] is 's' : return mot
if mot == 'ail': return 'aulx'
if mot in ail : return mot[:-2] + 'ux'
if mot in al : return mot[:-1] + 'ux'
if mot in ou : return mot + 'x'
if mot[-1] is 'x' : return mot
if mot[-1] is 'z' : return mot
if mot in eu : return mot + 's'
if mot in au : return mot + 's'
if mot in eau : return mot + 'x'
if mot == 'oeil' : return 'yeux'
if mot == 'ciel' : return 'cieux'
if mot == 'au' : return 'aux'
return mot + 's'
import sys
if len (sys.argv) > 1 :
for x in range(1, len(sys.argv)):
m = pluriel(sys.argv[x])
print m, #la virgule affiche un espace au lieu du saut de ligne
else : exit('argument manquant : mot')