#NEWLINE# def _step1ab( self , word ) : #NEWLINE# #INDENT# 'step1ab() gets rid of plurals and -ed or -ing. e.g.\n\n           caresses  ->  caress\n           ponies    ->  poni\n           sties     ->  sti\n           tie       ->  tie        (--NEW--: see below)\n           caress    ->  caress\n           cats      ->  cat\n\n           feed      ->  feed\n           agreed    ->  agree\n           disabled  ->  disable\n\n           matting   ->  mat\n           mating    ->  mate\n           meeting   ->  meet\n           milling   ->  mill\n           messing   ->  mess\n\n           meetings  ->  meet\n        ' #NEWLINE# if ( word [ ( - 1 ) ] == 's' ) : #NEWLINE# #INDENT# if word . endswith ( 'sses' ) : #NEWLINE# #INDENT# word = word [ : ( - 2 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'ies' ) : #NEWLINE# #INDENT# if ( len ( word ) == 4 ) : #NEWLINE# #INDENT# word = word [ : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# word = word [ : ( - 2 ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( word [ ( - 2 ) ] != 's' ) : #NEWLINE# #INDENT# word = word [ : ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# ed_or_ing_trimmed = False #NEWLINE# if word . endswith ( 'ied' ) : #NEWLINE# #INDENT# if ( len ( word ) == 4 ) : #NEWLINE# #INDENT# word = word [ : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# word = word [ : ( - 2 ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if word . endswith ( 'eed' ) : #NEWLINE# #INDENT# if ( self . _m ( word , ( len ( word ) - 4 ) ) > 0 ) : #NEWLINE# #INDENT# word = word [ : ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( word . endswith ( 'ed' ) and self . _vowelinstem ( word [ : ( - 2 ) ] ) ) : #NEWLINE# #INDENT# word = word [ : ( - 2 ) ] #NEWLINE# ed_or_ing_trimmed = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( word . endswith ( 'ing' ) and self . _vowelinstem ( word [ : ( - 3 ) ] ) ) : #NEWLINE# #INDENT# word = word [ : ( - 3 ) ] #NEWLINE# ed_or_ing_trimmed = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ed_or_ing_trimmed : #NEWLINE# #INDENT# if ( word . endswith ( 'at' ) or word . endswith ( 'bl' ) or word . endswith ( 'iz' ) ) : #NEWLINE# #INDENT# word += 'e' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . _doublec ( word ) : #NEWLINE# #INDENT# if ( word [ ( - 1 ) ] not in [ 'l' , 's' , 'z' ] ) : #NEWLINE# #INDENT# word = word [ : ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( self . _m ( word , ( len ( word ) - 1 ) ) == 1 ) and self . _cvc ( word , ( len ( word ) - 1 ) ) ) : #NEWLINE# #INDENT# word += 'e' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return word