Example #1
0
def parse_regexp():
    for file_name in walk_path("experts/"):
        with open(file_name, "rb") as fh:
            doc = etree.parse(fh)
            for group in parse_groups(doc):
                log.info("Importing %s" % group.get("name"))
                store_group(group)
Example #2
0
def parse_regexp():
    for file_name in walk_path('experts/'):
        with open(file_name, 'rb') as fh:
            doc = etree.parse(fh)
            for group in parse_groups(doc):
                log.info("Importing %s" % group.get('name'))
                store_group(group)
Example #3
0
def load_fts():
    for file_name in walk_path('fts/'):
        convert_file(file_name)
Example #4
0
def load_fts():
    for file_name in walk_path('fts/'):
        convert_file(file_name)
Example #5
0
def ted_documents():
    for file_name in walk_path('ted/xml/'):
        if not file_name.endswith('.xml'):
            continue
        with open(file_name, 'r') as fh:
            yield file_name, fh.read()