#NEWLINE# def lemmatization_only( self , document ) : #NEWLINE# #INDENT# ' Run only the lemmatization ' #NEWLINE# analysis = StanfordAnalysis ( self . corenlp . analyse ( document . text ) ) #NEWLINE# tokens = analysis . get_tokens ( ) #NEWLINE# if ( document . tokens != analysis ) : #NEWLINE# #INDENT# raise ValueError ( "Document changed since last tokenization, can't add lemmas to it" ) #NEWLINE# #UNINDENT# document . set_lemmatization_result ( analysis . get_lemmas ( ) ) #NEWLINE# document . save ( )