Commit 9fc8485c authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

add test node ordering

parent 3a7520b8
......@@ -6,6 +6,7 @@ test:
cd commands/delete_edge_feat && test.py && cd -
cd commands/edge_feat_update && test.py && cd -
cd commands/manipulate_modified_edge && test.py && cd -
cd commands/ordering && test.py && cd -
cd grep && test.py && cd -
cd lexicons/pattern && test.py && cd -
cd lexicons/percent && test.py && cd -
......
rule Y_after_X {
pattern { N1 [label=X]; N2 [label=Y]; N1 < N2 }
commands {
unorder N1;
insert N1 :> N2;
}
}
strat main { Onf (Y_after_X) }
{
"nodes": { "0": "X", "1": "Y", "2": "Z", "3": "X", "4": "Y" },
"order": [ "1", "0", "2", "4", "3" ]
}
{
"nodes": {
"1": "X",
"2": "Y",
"3": "Z",
"4": "X",
"5": "Y"
},
"order": ["1", "2", "3", "4", "5"]
}
#! /usr/bin/env python3
import sys
import os
sys.path.append(os.getcwd() + '/../..')
from utils import *
print ("--------------- ordering ---------------")
success('grew_dev transform -grs code.grs -config sud -quiet -i input.json -json', 'expected.json')
pattern {
V [cat=V];
V [upos=V];
V -[a_obj]-> A;
V -[de_obj]-> DE;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment