Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. def pluriel(mot):
  5.  
  6. ail='bail corail émail soupirail travail vantail vitrail'.split()
  7. ou='hibou chou genou caillou pou bijou'.split()
  8. eu='pneu bleu'.split()
  9. al='aval bal carnaval chacal corral final festival récital regal'.split()
  10. au='landau sarrau'.split()
  11. if mot in ail or mot in [x.upper() for x in ail]: return mot.lower()[:-2]+'ux'
  12. if mot in ou or mot in [x.upper() for x in ou]: return mot.lower() +'x'
  13. if mot in eu or mot in [x.upper() for x in eu]: return mot.lower()+'s'
  14. if mot in au or mot in [x.upper() for x in au]: return mot.lower()+'s'
  15. if mot in al or mot in [x.upper() for x in al]: return mot.lower()+'s'
  16. if mot[-1] in 'sSxXzZ': return mot
  17. if mot[-2:] == 'al' or mot[-2:] == 'AL': return mot.lower()[:-1]+'ux'
  18. if mot[-2:] == 'au' or mot[-2:] == 'AU': return mot.lower()+'x'
  19. if mot[-2:] == 'eu' or mot[-2:] == 'EU': return mot.lower()+'x'
  20. if mot is 'oeil' or mot is 'OEIL': return 'yeux'
  21. if mot is 'ail' or mot is 'AIL': return 'aulx'
  22. else: return mot.lower()+'s'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement