File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,22 @@ def fix_layout(layout):
134
134
cell .borders -= {"b" , "bb" , "t" , "tt" }
135
135
136
136
137
+ # does not deal with nested tags
138
+ # f.e., </bold></red><red><bold>
139
+ # or <bold><bold>
140
+ whitespace_tag_re = re .compile (r"<(bold|italic|red|green|blue)>(\s*)</\1>" )
141
+ dummy_close_tag_re = re .compile (r"</(bold|italic|red|green|blue)>(\s*)<\1>" )
142
+ def clear_cell (s ):
143
+ if "BP by Lyapunov equatio" in s :
144
+ print (s )
145
+ s = whitespace_tag_re .sub (r"\2" , s )
146
+ s = dummy_close_tag_re .sub (r"\2" , s )
147
+ return s .strip ()
148
+
149
+
137
150
def decouple_layout (df ):
138
151
split = df .applymap (lambda x : ("" , "" ) if x == "" else x .split (";" , 1 ))
139
- tab = split .applymap (lambda x : x [1 ])
152
+ tab = split .applymap (lambda x : clear_cell ( x [1 ]) )
140
153
layout = split .applymap (lambda x : to_layout (x [0 ]))
141
154
fix_layout (layout )
142
155
return tab , layout
Original file line number Diff line number Diff line change 10
10
11
11
# otherwise use this files
12
12
data = Path ("/mnt/efs/pwc/data" )
13
- goldtags_dump = data / "dumps" / "goldtags-2019.07.16_2214 .json.gz"
13
+ goldtags_dump = data / "dumps" / "goldtags-2019.07.31_1454-htlatex-latexml .json.gz"
14
14
15
15
16
16
elastic = dict (hosts = ['localhost' ], timeout = 20 )
You can’t perform that action at this time.
0 commit comments