#NEWLINE# def _step2( self , word ) : #NEWLINE# #INDENT# 'step2() maps double suffices to single ones.\n        so -ization ( = -ize plus -ation) maps to -ize etc. note that the\n        string before the suffix must give m() > 0.\n        ' #NEWLINE# if ( len ( word ) <= 1 ) : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# ch = word [ ( - 2 ) ] #NEWLINE# if ( ch == 'a' ) : #NEWLINE# #INDENT# if word . endswith ( 'ational' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 7 ) ] + 'ate' ) if ( self . _m ( word , ( len ( word ) - 8 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'tional' ) : #NEWLINE# #INDENT# return ( word [ : ( - 2 ) ] if ( self . _m ( word , ( len ( word ) - 7 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 'c' ) : #NEWLINE# #INDENT# if word . endswith ( 'enci' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 4 ) ] + 'ence' ) if ( self . _m ( word , ( len ( word ) - 5 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'anci' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 4 ) ] + 'ance' ) if ( self . _m ( word , ( len ( word ) - 5 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 'e' ) : #NEWLINE# #INDENT# if word . endswith ( 'izer' ) : #NEWLINE# #INDENT# return ( word [ : ( - 1 ) ] if ( self . _m ( word , ( len ( word ) - 5 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 'l' ) : #NEWLINE# #INDENT# if word . endswith ( 'bli' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 3 ) ] + 'ble' ) if ( self . _m ( word , ( len ( word ) - 4 ) ) > 0 ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'alli' ) : #NEWLINE# #INDENT# if ( self . _m ( word , ( len ( word ) - 5 ) ) > 0 ) : #NEWLINE# #INDENT# word = word [ : ( - 2 ) ] #NEWLINE# return self . _step2 ( word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'fulli' ) : #NEWLINE# #INDENT# return ( word [ : ( - 2 ) ] if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'entli' ) : #NEWLINE# #INDENT# return ( word [ : ( - 2 ) ] if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'eli' ) : #NEWLINE# #INDENT# return ( word [ : ( - 2 ) ] if self . _m ( word , ( len ( word ) - 4 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ousli' ) : #NEWLINE# #INDENT# return ( word [ : ( - 2 ) ] if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 'o' ) : #NEWLINE# #INDENT# if word . endswith ( 'ization' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 7 ) ] + 'ize' ) if self . _m ( word , ( len ( word ) - 8 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ation' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 5 ) ] + 'ate' ) if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ator' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 4 ) ] + 'ate' ) if self . _m ( word , ( len ( word ) - 5 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 's' ) : #NEWLINE# #INDENT# if word . endswith ( 'alism' ) : #NEWLINE# #INDENT# return ( word [ : ( - 3 ) ] if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ness' ) : #NEWLINE# #INDENT# if word . endswith ( 'iveness' ) : #NEWLINE# #INDENT# return ( word [ : ( - 4 ) ] if self . _m ( word , ( len ( word ) - 8 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'fulness' ) : #NEWLINE# #INDENT# return ( word [ : ( - 4 ) ] if self . _m ( word , ( len ( word ) - 8 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ousness' ) : #NEWLINE# #INDENT# return ( word [ : ( - 4 ) ] if self . _m ( word , ( len ( word ) - 8 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 't' ) : #NEWLINE# #INDENT# if word . endswith ( 'aliti' ) : #NEWLINE# #INDENT# return ( word [ : ( - 3 ) ] if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'iviti' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 5 ) ] + 'ive' ) if self . _m ( word , ( len ( word ) - 6 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'biliti' ) : #NEWLINE# #INDENT# return ( ( word [ : ( - 6 ) ] + 'ble' ) if self . _m ( word , ( len ( word ) - 7 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ch == 'g' ) : #NEWLINE# #INDENT# if word . endswith ( 'logi' ) : #NEWLINE# #INDENT# return ( word [ : ( - 1 ) ] if self . _m ( word , ( len ( word ) - 4 ) ) else word ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return word #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return word