def __read_data_meta_file(): meta_file_path = Advisor.get_data_file_meta_path() if path.exists(meta_file_path): with open(meta_file_path, "r") as json_file: meta = json.load(json_file) json_file.close() return meta return None
def __write_meta_data(language_list: list, tags: dict, data_version: int, lang_length: dict): data_file_meta_path = Advisor.get_data_file_meta_path() data_file_meta_content = {"languages": language_list, "lang_length": lang_length} data_process_version_meta_content = { "tags": tags, "token_ validation": {"must": ["alpha"], "must Not": ["stop_word", "space", "bracket", "currency", "url", "email", "number", "verb"]}} with open(data_file_meta_path, "w") as json_file: json.dump(data_file_meta_content, json_file, indent=4) json_file.close() for lang in language_list: data_version_meta_path = Advisor.get_data_version_folders_file_path(lang, data_version, "data-process-mata", "json") with open(data_version_meta_path, "w") as json_file: json.dump(data_process_version_meta_content, json_file, indent=4) json_file.close() return