For a predicative adjective, returns the attributive form (lowercase). In Dutch, the attributive is formed with -e: "fel" => "felle kritiek".
(adjective)
| 350 | } |
| 351 | |
| 352 | def attributive(adjective): |
| 353 | """ For a predicative adjective, returns the attributive form (lowercase). |
| 354 | In Dutch, the attributive is formed with -e: "fel" => "felle kritiek". |
| 355 | """ |
| 356 | w = adjective.lower() |
| 357 | if w in adjective_attributive: |
| 358 | return adjective_attributive[w] |
| 359 | if w.endswith("e"): |
| 360 | return w |
| 361 | if w.endswith(("er","st")) and len(w) > 4: |
| 362 | return w + "e" |
| 363 | if w.endswith("ees"): |
| 364 | return w[:-2] + w[-1] + "e" |
| 365 | if w.endswith("el") and len(w) > 2 and not is_vowel(w[-3]): |
| 366 | return w + "e" |
| 367 | if w.endswith("ig"): |
| 368 | return w + "e" |
| 369 | if len(w) > 2 and (not is_vowel(w[-1]) and is_vowel(w[-2]) and is_vowel(w[-3]) or w[:-1].endswith("ij")): |
| 370 | if w.endswith("f"): w = w[:-1] + "v" |
| 371 | if w.endswith("s"): w = w[:-1] + "z" |
| 372 | if w[-2] == w[-3]: |
| 373 | w = w[:-2] + w[-1] |
| 374 | elif len(w) > 1 and is_vowel(w[-2]) and w.endswith(tuple("bdfgklmnprst")): |
| 375 | w = w + w[-1] |
| 376 | return w + "e" |
| 377 | |
| 378 | adjective_predicative = dict((v,k) for k,v in adjective_attributive.iteritems()) |
| 379 | adjective_predicative.update({ |