def generate_amr_lines(f1, f2):
while True:<EOL><INDENT>cur_amr1 = amr.AMR.get_amr_line(f1)<EOL>cur_amr2 = amr.AMR.get_amr_line(f2)<EOL>if not cur_amr1 and not cur_amr2:<EOL><INDENT>pass<EOL><DEDENT>elif not cur_amr1:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>print("<STR_LIT>", file=ERROR_LOG)<EOL><DEDENT>elif not cur_amr2:<EOL><INDENT>print("<STR_LIT>", file=ERROR_LOG)<EOL>print("<STR_LIT>", file=ERROR_LOG)<EOL><DEDENT>else:<EOL><INDENT>yield cur_amr1, cur_amr2<EOL>continue<EOL><DEDENT>break<EOL><DEDENT>
Read one AMR line at a time from each file handle
:param f1: file handle (or any iterable of strings) to read AMR 1 lines from
:param f2: file handle (or any iterable of strings) to read AMR 2 lines from
:return: generator of cur_amr1, cur_amr2 pairs: one-line AMR strings