from pathlib import Path


def get_old_vol(pecha_opf_path, pecha_id, text_vol_span):
    """Generate old base text in which text is located

    Args:
        pecha_opf_path (str): pecha opf path
        pecha_id (str): pecha id 
        text_vol_span (list): list of volume ids in which text is located

    Returns:
        dict: volid as key and base as value
    """
    old_vols = {}
    for vol_id in text_vol_span:
        old_vols[vol_id] = Path(
            f"{pecha_opf_path}/{pecha_id}.opf/base/{vol_id}.txt"
        ).read_text(encoding="utf-8")
    return old_vols