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

Function grade

pattern/text/de/inflect.py:549–557  ·  view source on GitHub ↗

Returns the comparative or superlative form of the given (inflected) adjective.

(adjective, suffix=COMPARATIVE)

Source from the content-addressed store, hash-verified

547SUPERLATIVE = "st"
548
549def grade(adjective, suffix=COMPARATIVE):
550 """ Returns the comparative or superlative form of the given (inflected) adjective.
551 """
552 b = predicative(adjective)
553 # groß => großt, schön => schönst
554 if suffix == SUPERLATIVE and b.endswith(("s", u"ß")):
555 suffix = suffix[1:]
556 # große => großere, schönes => schöneres
557 return adjective[:len(b)] + suffix + adjective[len(b):]
558
559def comparative(adjective):
560 return grade(adjective, COMPARATIVE)

Callers 2

comparativeFunction · 0.70
superlativeFunction · 0.70

Calls 2

lenFunction · 0.85
predicativeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…