@staticmethod<EOL><INDENT>def get_amr_line(input_f):<DEDENT>
cur_amr = []<EOL>has_content = False<EOL>for line in input_f:<EOL><INDENT>line = line.strip()<EOL>if line == "<STR_LIT>":<EOL><INDENT>if not has_content:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if line.strip().startswith("<STR_LIT:#>"):<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>has_content = True<EOL>cur_amr.append(line.strip())<EOL><DEDENT><DEDENT>return "<STR_LIT>".join(cur_amr)<EOL>
Read the file containing AMRs. AMRs are separated by a blank line.
Each call of get_amr_line() returns the next available AMR (in one-line form).
Note: this function does not verify if the AMR is valid