summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-01 23:19:59 +0200
committerPatrick Simianer <p@simianer.de>2014-06-01 23:19:59 +0200
commitde3137d5dbb2dadd799312e1d2b3cb6ddce4a23d (patch)
tree5fa987e9fd56a432e8e113c7468df271dfeef2f0
parent4921f3e8938b5c219b0481870e1b33b291659bd5 (diff)
hg2json.py: add rule and span to json output
-rwxr-xr-xhg2json.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/hg2json.py b/hg2json.py
index 5bd5c2c..fc9ba2b 100755
--- a/hg2json.py
+++ b/hg2json.py
@@ -30,6 +30,9 @@ def hg2json(hg, weights):
for i in hg.edges:
s = "{"
s += '"head":"%s"'%(i.head_node.id)
+ s += ', "rule":"%s"'%(i.trule)
+ s += ', "left":%d'%(i.span[0])
+ s += ', "right":%d'%(i.span[1])
xs = ' "f":{'
b = []
for j in i.feature_values: