parameters: (directory)
return_statement: return train_path
docstring: Download the WMT en-fr training corpus to directory unless it's there.
docstring_summary: Download the WMT en-fr training corpus to directory unless it's there.
docstring_tokens: Download the WMT en - fr training corpus to directory unless it s there .
function: def get_wmt_enfr_train_set(directory):
    """Download the WMT en-fr training corpus to directory unless it's there."""
    train_path = os.path.join(directory, "giga-fren.release2")
    if not (gfile.Exists(train_path +".fr") and gfile.Exists(train_path +".en")):
      corpus_file = maybe_download(directory, "training-giga-fren.tar",
                                   _WMT_ENFR_TRAIN_URL)
      print("Extracting tar file %s" % corpus_file)
      with tarfile.open(corpus_file, "r") as corpus_tar:
        corpus_tar.extractall(directory)
      gunzip_file(train_path + ".fr.gz", train_path + ".fr")
      gunzip_file(train_path + ".en.gz", train_path + ".en")
    return train_path
function_tokens: def get_wmt_enfr_train_set ( directory ) : train_path = os . path . join ( directory , "giga-fren.release2" ) if not ( gfile . Exists ( train_path + ".fr" ) and gfile . Exists ( train_path + ".en" ) ) : corpus_file = maybe_download ( directory , "training-giga-fren.tar" , _WMT_ENFR_TRAIN_URL ) print ( "Extracting tar file %s" % corpus_file ) with tarfile . open ( corpus_file , "r" ) as corpus_tar : corpus_tar . extractall ( directory ) gunzip_file ( train_path + ".fr.gz" , train_path + ".fr" ) gunzip_file ( train_path + ".en.gz" , train_path + ".en" ) return train_path