From f66d0c8be7beba0436d01f5a37dc83bcdfaf872f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Fri, 22 Nov 2019 14:42:19 +0100 Subject: [PATCH] Prepare for more complex handling of the transition --- tools/lib/data.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/lib/data.py b/tools/lib/data.py index 83df3ad0..d4d7e606 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -33,9 +33,10 @@ class dataFileBase(object): def convertState(StateTablelist,firstState=state(1,1,"A_1")): tmplst=[] for TexState in StateTablelist: - st=list(TexState.find("$").contents)[0] - m=re.match(r"^\^(?P\d)(?P\S+)",st) - seq=m.groups() + lst=list(TexState.find("$").contents) + st=str(lst[0]) + m=re.match(r"^\^(?P\d)(?P[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P\w)(?:})\])?\s*\((?P[^\)]*)\)",st) + seq=m.group("multiplicity","symm") tmplst.append(seq) lst=[] for index,item in enumerate(tmplst):