Skip to content

Commit 79ada2f

Browse files
Fixes error in how arguments within copular clauses, which are always headed by nouns and not adjectives or otherwise, are linked to the syntax nodes they are instantiated by. This only affects the genericity annotations, since the other annotation sets do not annotate these arguments. The error caused a self-loop on the argument node itself due to faulty string replacement logic. The offending block no longer uses such logic, but it is still used elsewhere (without effect, due to parameter settings on which nodes actually get added to the graph by default in this version) and needs to be phased out completely eventually in favor of using attributes themselves. This fix uses such a strategy, where now the head and span information is an attribute of the node, though only the head information is currently used. Also removes an errant print statement in node queries.
1 parent 1c23874 commit 79ada2f

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

decomp/data/1.0/annotations/genericity.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

decomp/semantics/uds.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ def _node_query(self, query: Union[str, Query],
466466
cache_query=cache_query)]
467467

468468
try:
469-
print(results)
470469
return {nodeid: self.graph.nodes[nodeid] for nodeid in results}
471470
except KeyError:
472471
errmsg = 'invalid node query: your query must be guaranteed ' +\
@@ -834,12 +833,19 @@ def _add_node_annotation(self, node, attrs,
834833
self.graph.add_node(node,
835834
**{k: v
836835
for k, v in attrs.items()
837-
if k != 'headof'})
836+
if k not in ['headof',
837+
'head',
838+
'span']})
838839
self.graph.add_edge(*edge, domain='semantics', type='head')
839840

840-
instedge = (node, node.replace('semantics-subarg', 'syntax'))
841+
instedge = (node, attrs['head'])
841842
self.graph.add_edge(*instedge, domain='interface', type='head')
842843

844+
# for nonhead in attrs['span']:
845+
# if nonhead != attrs['head']:
846+
# instedge = (node, nonhead)
847+
# self.graph.add_edge(*instedge, domain='interface', type='head')
848+
843849
elif 'subargof' in attrs and attrs['subargof'] in self.graph.nodes:
844850
edge = (attrs['subargof'], node)
845851

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Aaron Steven White'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '0.1.0'
25+
release = '0.1.1'
2626

2727
# Changes root document from contents.rst to index.rst
2828
master_doc = 'index'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import find_packages, setup
22

33
setup(name='decomp',
4-
version='0.1.0',
4+
version='0.1.1',
55
description='Toolkit for working with Universal\
66
Decompositional Semantics graphs',
77
url='https://decomp.io/',

0 commit comments

Comments
 (0)