def read_relation_file(filename):
with open(filename, '<STR_LIT:rb>') as input_file:<EOL><INDENT>doc = etree.parse(input_file)<EOL><DEDENT>lex_rels = []<EOL>con_rels = []<EOL>assert doc.getroot().tag == '<STR_LIT>'<EOL>for child in doc.getroot():<EOL><INDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>if <NUM_LIT:0> < len(child):<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>child_dict = dict(child.items())<EOL>warn_attribs('<STR_LIT>', child, RELATION_ATTRIBS, RELATION_ATTRIBS_REQD)<EOL>if child_dict['<STR_LIT>'] not in LEX_REL_DIRS:<EOL><INDENT>print('<STR_LIT>', child_dict['<STR_LIT>'])<EOL><DEDENT>if child_dict['<STR_LIT>'] == '<STR_LIT>' and '<STR_LIT>' not in child_dict:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>lex_rels.append(child_dict)<EOL><DEDENT>elif child.tag == '<STR_LIT>':<EOL><INDENT>if <NUM_LIT:0> < len(child):<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>child_dict = dict(child.items())<EOL>warn_attribs('<STR_LIT>', child, RELATION_ATTRIBS, RELATION_ATTRIBS_REQD)<EOL>if child_dict['<STR_LIT>'] not in CON_REL_DIRS:<EOL><INDENT>print('<STR_LIT>', child_dict['<STR_LIT>'])<EOL><DEDENT>if (child_dict['<STR_LIT>'] in ['<STR_LIT>', '<STR_LIT>'] and<EOL>'<STR_LIT>' not in child_dict):<EOL><INDENT>print('<STR_LIT>'.format(<EOL>child_dict['<STR_LIT>']))<EOL><DEDENT>con_rels.append(child_dict)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>', child)<EOL>continue<EOL><DEDENT><DEDENT>return lex_rels, con_rels<EOL>
Reads the GermaNet relation file ``gn_relations.xml`` which lists
all the relations holding between lexical units and synsets.

Arguments:
- `filename`: