from pathlib import Path


def data_paths(root):
    """Get the paths for the processed data

    Note:
        This first requires that you use `frame`'s cli
        to preprocess the framenet data into json files.

    Args:
        root: root path to the json preprocessed data

    Raises:
        `ValueError`: if the files do not exist in the `root` 
        directory. Make sure to prepocess the data using `frame`'s
        frame.cli:preprocess-framenet before loading the data.
    """
    path = Path(root).glob("**/*")
    paths = [str(p) for p in path]

    if len(paths) == 0:
        raise ValueError(
            f"Preprocessed data not found at <{root}>! Use frame.cli:preprocess-framenet"
        )

    return paths