#NEWLINE# def tag( self , data ) : #NEWLINE# #INDENT# "\n        Tags a single sentence\n\n        :param data: list of words\n        :type data: [string,]\n\n        :return: [(word, tag),]\n\n        Calls recursive function '_tagword'\n        to produce a list of tags\n\n        Associates the sequence of returned tags\n        with the correct words in the input sequence\n\n        returns a list of (word, tag) tuples\n        " #NEWLINE# current_state = [ ( [ 'BOS' , 'BOS' ] , 0.0 ) ] #NEWLINE# sent = list ( data ) #NEWLINE# tags = self . _tagword ( sent , current_state ) #NEWLINE# res = [ ] #NEWLINE# for i in range ( len ( res ) ) : #NEWLINE# #INDENT# ( t , C ) = tags [ ( i + 2 ) ] #NEWLINE# res . append ( ( sent [ i ] , t ) ) #NEWLINE# #UNINDENT# return res