MCPcopy Index your code
hub / github.com/clips/pattern / predicative

Function predicative

pattern/text/nl/inflect.py:385–415  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

383})
384
385def 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

Callers 2

find_lemmataFunction · 0.90
instanceFunction · 0.90

Calls 2

lenFunction · 0.85
is_vowelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…