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)
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)
def load_fts(): for file_name in walk_path('fts/'): convert_file(file_name)
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()