#NEWLINE# def grade( adjective , suffix = COMPARATIVE ) : #NEWLINE# #INDENT# ' Returns the comparative or superlative form of the given adjective.\n    ' #NEWLINE# n = _count_syllables ( adjective ) #NEWLINE# if ( adjective in grade_irregular ) : #NEWLINE# #INDENT# return grade_irregular [ adjective ] [ ( suffix != COMPARATIVE ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( adjective in grade_uninflected ) : #NEWLINE# #INDENT# return ( '%s %s' % ( ( ( ( suffix == COMPARATIVE ) and 'more' ) or 'most' ) , adjective ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( n <= 2 ) and adjective . endswith ( 'e' ) ) : #NEWLINE# #INDENT# suffix = suffix . lstrip ( 'e' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( n == 1 ) and ( len ( suffix ) >= 3 ) and ( adjective [ ( - 1 ) ] not in VOWELS ) and ( adjective [ ( - 2 ) ] in VOWELS ) and ( adjective [ ( - 3 ) ] not in VOWELS ) ) : #NEWLINE# #INDENT# if ( not adjective . endswith ( 'w' ) ) : #NEWLINE# #INDENT# suffix = ( adjective [ ( - 1 ) ] + suffix ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( n == 1 ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( n == 2 ) and adjective . endswith ( 'y' ) ) : #NEWLINE# #INDENT# adjective = ( adjective [ : ( - 1 ) ] + 'i' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( n == 2 ) and ( adjective [ ( - 2 ) : ] in ( 'er' , 'le' , 'ow' ) ) ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( '%s %s' % ( ( ( ( suffix == COMPARATIVE ) and 'more' ) or 'most' ) , adjective ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( adjective + suffix )