From: Mart Lubbers Date: Mon, 26 May 2014 20:50:54 +0000 (+0200) Subject: eia X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=25062c44d8f30033171f8ee1328da0716113ce80;p=bsc-thesis1415.git eia --- diff --git a/program/hypconvert/hypconvert.py b/program/hypconvert/hypconvert.py index cf67dfd..34548ff 100644 --- a/program/hypconvert/hypconvert.py +++ b/program/hypconvert/hypconvert.py @@ -8,7 +8,7 @@ import re re_hdr = re.compile('(?P.*?)') re_row = re.compile('(?P.*?)') re_cel = re.compile('(?P.*?)') -re_spa = re.compile('(?P.*?);.*>).*?(?P)') +re_spa = re.compile('(?P.*?);.*?>)(?P.*?)(?P)') def structure_data(d): @@ -26,10 +26,14 @@ def structure_data(d): def parse_line(line): logging.debug('parsing line: {}'.format(line)) + results = [] for column in line: logging.debug('parsing column: {}'.format(column)) markings = list(re_spa.finditer(column)) - print markings + if markings: + results.append(markings) + logging.debug('found {} spans in the column'.format(len(markings))) + logging.debug('found {} columns with markings'.format(len(results))) def main(): @@ -52,5 +56,5 @@ def main(): if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) + logging.basicConfig(level=logging.DEBUG) main()