#NEWLINE# def translate( self , words ) : #NEWLINE# #INDENT# if ( ( type ( words ) is str ) or ( len ( words ) == 1 ) ) : #NEWLINE# #INDENT# self . _logger . debug ( 'Converting single word to phonemes' ) #NEWLINE# output = self . _translate_word ( ( words if ( type ( words ) is str ) else words [ 0 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _logger . debug ( 'Converting %d words to phonemes' , len ( words ) ) #NEWLINE# output = self . _translate_words ( self ) #NEWLINE# #UNINDENT# self . _logger . debug ( 'G2P conversion returned phonemes for %d words' , len ( output ) ) #NEWLINE# return output