def _load_dbs(fnames: Sequence[str]) -> Sequence[Type[RankingDatabase]]: def get_name(fname): return os.path.splitext(os.path.basename(fname))[0] return [ opendb(fname=fname.name, name=get_name(fname.name)) for fname in fnames ]
def convert(out_folder, in_fnames, topn): for fname in in_fnames: print("Inverting {}".format(fname.name)) name = derive_db_name(fname.name) InvertedRankingDatabase.invert(opendb(fname=fname.name, name=name), os.path.join(out_folder, "{}.inverted.feather".format(name)), topn)
def _load_dbs(fnames: Sequence[str], nomenclature: str) -> Sequence[Type[RankingDatabase]]: def get_name(fname): return os.path.basename(fname).split(".")[0] return [ opendb(fname=fname.name, name=get_name(fname.name), nomenclature=nomenclature) for fname in fnames ]