import os

from pytlex_core import TimeMLParser
from pytlex_tests.jTLEX_Data import jTLEX_Counts

if __name__ == '__main__':
    print()
    filepath = r"../pytlex_data/TimeBankCorpus"
    for subdir, dirs, files in os.walk(filepath):
        for filename in files:
            with open(filepath + "/" + filename) as timeMLFile:
                event_list = TimeMLParser.parse_events(timeMLFile.read())
                if len(event_list) != jTLEX_Counts.jTLEX_instance_count[filename]:
                    print("{}: {}, {}".format(filename, len(event_list), jTLEX_Counts.jTLEX_instance_count[filename]))

failed_parse = {'ABC19980304.1830.1636.tml', 'APW19980213.1320.tml', 'APW19980227.0468.tml', 'APW19980227.0489.tml'}

