log.error('directory not found : ' + str(output_dir)) sys.exit(1) jpDB = Japanese_DB_handler() f = jpDB.base_format config_data = configuration.get_configuration() if not config_data: log.error("couldn't find get configuration data") sys.exit(1) cat_dir = {} tag_dir = {} cat_list = jpDB.list_categorie_by_usage() tag_list = jpDB.list_tag_by_usage() for cat, _ in cat_list: if not cat: continue cat_dir[cat] = [ data[0] for data in jpDB.list_word_by_categorie(cat, f.vocab.word, limit=5) ] for tag, _ in tag_list: if not tag: continue tag_dir[tag] = [ data[0] for data in jpDB.list_word_by_tag(tag, f.vocab.word, limit=5) ]
def get_selector_list_data(): jpDB = Japanese_DB_handler() sel_list = jpDB.list_tag_by_usage(include_id=True) sel_number = jpDB.count(jpDB.base_format.tags) return sel_list, sel_number