Skip to content

Commit

Permalink
fix: use close neighbors in openClosedUniGenerator.py
Browse files Browse the repository at this point in the history
This is to address part of the problems in robotools#140 that some open parentheses does not match the closed ones.
These would only leave special exceptions and ornate parentheses (which is because of reversed order in the data) needed to be appended.
  • Loading branch information
medicalwei authored Nov 6, 2017
1 parent 0b8e5bd commit f59163e
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tools/openClosedUniGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@
for line in text.splitlines():
line = line.split(";")
value, name, category = line[:3]
if category in ("Ps", "Pe", "Pi", "Pf"):
if openValue is None:
if category in ("Ps", "Pi"):
#assert category in ("Ps", "Pi")
openValue = (value, name, category)
else:
#assert category in ("Pe", "Pf")
if category not in ("Pe", "Pf"):
result.append("#%s;%s;%s" % (value, name, category))
result.append("")
else:
result.append("%s;%s;%s" % openValue)
result.append("%s;%s;%s" % (value, name, category))
result.append("")
openValue = None
elif category in ("Pe", "Pf") and openValue is not None:
result.append("%s;%s;%s" % openValue)
result.append("%s;%s;%s" % (value, name, category))
result.append("")
openValue = None

print("\n".join(result))

0 comments on commit f59163e

Please sign in to comment.