(table0)
| 212 | return item, tag |
| 213 | |
| 214 | def convert(table0): |
| 215 | dic = {} |
| 216 | table = [] |
| 217 | for tab in table0: |
| 218 | if tab.find('|')==-1: |
| 219 | if len(tab.split(':'))==2: |
| 220 | tab = '| '+tab.split(':')[0]+' | '+tab.split(':')[1]+' |' |
| 221 | else: |
| 222 | continue |
| 223 | if tab.strip(' ')[0]!='|': |
| 224 | tab = '|'+tab |
| 225 | if tab.strip(' ')[-1]!='|': |
| 226 | tab = tab+'|' |
| 227 | table.append(tab) |
| 228 | if len(table)<2: |
| 229 | return dic |
| 230 | segs = table[0].strip('\n').strip(' ')[1:-1].split('|') |
| 231 | if len(segs)<2: |
| 232 | return dic |
| 233 | tag = 1 |
| 234 | for seg in segs: |
| 235 | wd,tmptag = deep_reduce(seg) |
| 236 | if tmptag==0: |
| 237 | tag = 0 |
| 238 | break |
| 239 | if tag and len(table)>2: |
| 240 | vals = table[2].strip('\n').strip(' ')[1:-1].split('|') |
| 241 | if len(vals)!=len(segs): |
| 242 | return {} |
| 243 | for idx in range(len(segs)): |
| 244 | wd,tmptag = deep_reduce(segs[idx]) |
| 245 | dic[wd] = vals[idx] |
| 246 | return dic |
| 247 | for line in table: |
| 248 | wds = line.strip('\n').strip(' ')[1:-1].split('|') |
| 249 | if len(wds)!=2: |
| 250 | continue |
| 251 | wd,tmptag = deep_reduce(wds[0]) |
| 252 | if tmptag: |
| 253 | dic[wd] = wds[1] |
| 254 | return dic |
| 255 | |
| 256 | def combine(tables, tables1=None, crit=None): |
| 257 | extra_query = [] |
no test coverage detected