MCPcopy Create free account
hub / github.com/Clearailhc/ACE2005-toolkit / parse_xml

Method parse_xml

ace_parser.py:11–22  ·  view source on GitHub ↗
(self, xml_path)

Source from the content-addressed store, hash-verified

9 self.parse_xml(path + '.apf.xml')
10
11 def parse_xml(self, xml_path):
12 tree = ElementTree.parse(xml_path)
13 root = tree.getroot()
14 for child in root[0]:
15 if child.tag == 'entity':
16 self.entity_mentions.extend(self.parse_entity_tag(child))
17 elif child.tag in ['value', 'timex2']:
18 self.entity_mentions.extend(self.parse_value_timex_tag(child))
19 elif child.tag == 'event':
20 self.event_mentions.extend(self.parse_event_tag(child))
21 elif child.tag == 'relation':
22 self.relation_mentions.extend(self.parse_relation_tag(child))
23
24 @staticmethod
25 def parse_entity_tag(node):

Callers 1

__init__Method · 0.95

Calls 5

parse_entity_tagMethod · 0.95
parse_value_timex_tagMethod · 0.95
parse_event_tagMethod · 0.95
parse_relation_tagMethod · 0.95
parseMethod · 0.80

Tested by

no test coverage detected