-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DOIs for AACL 2020, AACL 2022, and EMNLP 2024 (#4104)
Also added a script that generates all volumes associated with an event (given the XML file).
- Loading branch information
Showing
39 changed files
with
3,568 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Takes an XML file and returns all volumes within it. It will also | ||
return all colocated volumes. This is a convenient way to generate | ||
a list of all volumes associated with an event. | ||
""" | ||
|
||
import lxml.etree as ET | ||
|
||
|
||
def get_volumes(xml_file): | ||
tree = ET.parse(xml_file) | ||
root = tree.getroot() | ||
|
||
collection_id = root.attrib['id'] | ||
|
||
volumes = [] | ||
for volume in root.findall(".//volume"): | ||
volume_id_full = collection_id + "-" + volume.attrib['id'] | ||
volumes.append(volume_id_full) | ||
|
||
# get the <colocated> node under <event> | ||
event_node = root.find(".//event") | ||
if event_node is not None: | ||
colocated = event_node.find("colocated") | ||
if colocated is not None: | ||
for volume in colocated.findall("volume-id"): | ||
volumes.append(volume.text) | ||
|
||
return volumes | ||
|
||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('xml_file', help='XML file to process') | ||
args = parser.parse_args() | ||
|
||
print(" ".join(get_volumes(args.xml_file))) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.