commit 88c5db31c2640b5f7db709c0e40c7bc69f101ee7
parent 50379b128bc817f4d7d18eb03556f3bf3c03a506
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Wed, 26 Aug 2015 22:08:28 +0200
better fem
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common.py b/common.py
@@ -16,7 +16,8 @@ def is_pref(u, v):
return True
def fem(w):
- return w.endswith('e') or w.endswith('es')
+ return ((w.endswith('e') and not w[-2] in "ui")
+ or (w.endswith('es') and not w[-3] in "ui"))
# http://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string