KwabsHug commited on
Commit
9c949f0
1 Parent(s): fb38229

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -194,19 +194,17 @@ def create_dictionary(word_list, word_dict = {}):
194
  word_dict[key].append(word)
195
  return word_dict
196
 
197
- def merge_lines(doc1, doc2, doc3, doc4):
198
- docs = [doc1, doc2, doc3, doc4]
199
  merged_lines = []
200
 
201
- with open(doc1, "r") as f1, open(doc2, "r") as f2, \
202
- open(doc3, "r") as f3, open(doc4, "r") as f4, \
203
- open("merged_lines.txt", "w") as f_out:
204
  for lines in zip(f1, f2, f3, f4):
205
  merged_line = "".join(line.strip() for line in lines)
206
- f_out.write(merged_line + "\n")
207
  merged_lines.append(merged_line)
208
 
209
- return merged_lines
210
 
211
  def TTSforListeningPractice(text):
212
  return "not finished"
 
194
  word_dict[key].append(word)
195
  return word_dict
196
 
197
+ def merge_lines(roman_file, w4w_file, full_mean_file, macaronic_file):
198
+ files = [roman_file, w4w_file, full_mean_file, macaronic_file]
199
  merged_lines = []
200
 
201
+ with open(roman_file.name, "r") as f1, open(w4w_file.name, "r") as f2, \
202
+ open(full_mean_file.name, "r") as f3, open(macaronic_file.name, "r") as f4:
 
203
  for lines in zip(f1, f2, f3, f4):
204
  merged_line = "".join(line.strip() for line in lines)
 
205
  merged_lines.append(merged_line)
206
 
207
+ return "\n".join(merged_lines)
208
 
209
  def TTSforListeningPractice(text):
210
  return "not finished"