MCPcopy Create free account
hub / github.com/clips/pattern / predicative

Function predicative

pattern/text/de/inflect.py:524–542  ·  view source on GitHub ↗

Returns the predicative adjective (lowercase). In German, the attributive form preceding a noun is always used: "ein kleiner Junge" => strong, masculine, nominative, "eine schöne Frau" => mixed, feminine, nominative, "der kleine Prinz" => weak, masculine, nominative,

(adjective)

Source from the content-addressed store, hash-verified

522 return w + adjectives_strong.get((g, c), "")
523
524def predicative(adjective):
525 """ Returns the predicative adjective (lowercase).
526 In German, the attributive form preceding a noun is always used:
527 "ein kleiner Junge" => strong, masculine, nominative,
528 "eine schöne Frau" => mixed, feminine, nominative,
529 "der kleine Prinz" => weak, masculine, nominative, etc.
530 The predicative is useful for lemmatization.
531 """
532 w = adjective.lower()
533 if len(w) > 3:
534 for suffix in ("em", "en", "er", "es", "e"):
535 if w.endswith(suffix):
536 b = w[:max(-len(suffix), -(len(w)-3))]
537 if b.endswith("bl"): # plausibles => plausibel
538 b = b[:-1] + "el"
539 if b.endswith("pr"): # propres => proper
540 b = b[:-1] + "er"
541 return b
542 return w
543
544#### COMPARATIVE & SUPERLATIVE #####################################################################
545

Callers 2

find_lemmataFunction · 0.90
gradeFunction · 0.70

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…