parameters: (file_path, source)
return_statement: return data
docstring: Read file, where each sentence is dilineated by a `\n`.
      @param file_path (str): path to file containing corpus
      @param source (str): "tgt" or "src" indicating whether text
          is of the source language or target language
docstring_summary: Read file, where each sentence is dilineated by a `\n`.
docstring_tokens: Read file where each sentence is dilineated by a \ n .
function: def read_corpus(file_path, source):
      """ Read file, where each sentence is dilineated by a `\n`.
      @param file_path (str): path to file containing corpus
      @param source (str): "tgt" or "src" indicating whether text
          is of the source language or target language
      """
      data = []
      for line in open(file_path):
          sent = nltk.word_tokenize(line)
          # only append <s> and </s> to the target sentence
          if source == 'tgt':
              sent = ['<s>'] + sent + ['</s>']
          data.append(sent)
  
      return data
function_tokens: def read_corpus ( file_path , source ) : data = [ ] for line in open ( file_path ) : sent = nltk . word_tokenize ( line ) # only append <s> and </s> to the target sentence if source == 'tgt' : sent = [ '<s>' ] + sent + [ '</s>' ] data . append ( sent ) return data