--- /dev/null
+#!/usr/bin/env python2
+
+import sys
+import re
+
+sys.stderr.write("""Usage: {} [INPUT [OUTPUT]
+als input/output niet specificeerd pakt hij stdin/stdout
+voorbeeld:
+\t$ < file.dot ./van_learnlib_naar_dot.py | dot -Tpdf > file.pdf
+""".format(sys.argv[0]))
+
+if len(sys.argv) == 1:
+ inputfile = sys.stdin
+ outputfile = sys.stdout
+elif len(sys.argv) == 2:
+ inputfile = open(sys.argv[1], 'r')
+ outputfile = sys.stdout
+else:
+ inputfile = open(sys.argv[1], 'r')
+ outputfile = open(sys.argv[2], 'w')
+
+data = []
+pat = r's(?P<f>\d+) -> s(?P<t>\d+) \[label="(?P<i>\S+) / (?P<o>\S+)"\];'
+
+for line in inputfile:
+ match = re.search(pat, line)
+ if match:
+ outputfile.write('\ts{0} -> s{0}_ [label="!{1}"]\n'.format(
+ match.group('f'), match.group('i')))
+ outputfile.write('\ts{}_ -> s{} [label="?{}"]\n'.format(
+ match.group('f'), match.group('t'), match.group('o')))
+ else:
+ outputfile.write(line)
+
+if inputfile != sys.stdin:
+ inputfile.close()
+if outputfile != sys.stdout:
+ outputfile.close()