!7 S text = [[ One node "A". One node "B". B to the right of A. ]]; static new TreeSet nodes; static new LinkedHashSet relations; static new TreeMap coordinates; p { for (S s : sentences(text)) { if "One node *" nodes.add($1); else if "* to the right of *" relations.add(new Relation("to the right of", $1, $2)); } print("Got nodes: " + sfu(nodes)); print("Got relations: " + sfu(relations)); makeCoordinates(); print("Got coordinates: " + sfu(coordinates)); } svoid makeCoordinates { for (S node : nodes) coordinates.put(node, pt(random(100), random(100))); }