''' Purpose: use polygot module to translate url indicated text ''' # import needed modules import polyglot # local module supporting text translation import url # local module supporting text acquisition # define url text source MACBETH = 'http://www.cs.virginia.edu/~cs1112/datasets/words/macbeth.gaeilge' # get the text from the url gaeilge = url.get_contents( MACBETH ) # print the text to be translated print( gaeilge ) print( '\n-----------------------------------------\n' ) # get a translation of the text english = polyglot.translate( gaeilge ) # print the translation print( english )