Returns the predicative adjective (lowercase). In Dutch, the attributive form preceding a noun is common: "rake opmerking" => "raak", "straffe uitspraak" => "straf", "dwaze blik" => "dwaas".
(adjective)
| 383 | }) |
| 384 | |
| 385 | def predicative(adjective): |
| 386 | """ Returns the predicative adjective (lowercase). |
| 387 | In Dutch, the attributive form preceding a noun is common: |
| 388 | "rake opmerking" => "raak", "straffe uitspraak" => "straf", "dwaze blik" => "dwaas". |
| 389 | """ |
| 390 | w = adjective.lower() |
| 391 | if w in adjective_predicative: |
| 392 | return adjective_predicative[w] |
| 393 | if w.endswith("ste"): |
| 394 | return w[:-1] |
| 395 | if w.endswith("ere"): |
| 396 | return w[:-1] |
| 397 | if w.endswith("bele"): |
| 398 | return w[:-1] |
| 399 | if w.endswith("le") and len(w) > 2 and is_vowel(w[-3]) and not w.endswith(("eule", "oele")): |
| 400 | return w[:-2] + w[-3] + "l" |
| 401 | if w.endswith("ve") and len(w) > 2 and is_vowel(w[-3]) and not w.endswith(("euve", "oeve", "ieve")): |
| 402 | return w[:-2] + w[-3] + "f" |
| 403 | if w.endswith("ze") and len(w) > 2 and is_vowel(w[-3]) and not w.endswith(("euze", "oeze", "ieze")): |
| 404 | return w[:-2] + w[-3] + "s" |
| 405 | if w.endswith("ve"): |
| 406 | return w[:-2] + "f" |
| 407 | if w.endswith("ze"): |
| 408 | return w[:-2] + "s" |
| 409 | if w.endswith("e") and len(w) > 2: |
| 410 | if not is_vowel(w[-2]) and w[-2] == w[-3]: |
| 411 | return w[:-2] |
| 412 | if len(w) > 3 and not is_vowel(w[-2]) and is_vowel(w[-3]) and w[-3] != "i" and not is_vowel(w[-4]): |
| 413 | return w[:-2] + w[-3] + w[-2] |
| 414 | return w[:-1] |
| 415 | return w |
no test coverage detected
searching dependent graphs…