from pathlib import Path
from typing import List


def _split_pbn(file_path: Path) -> List[List[str]]:
    """
    Read in the entire PBN file. Split on lines consisting of '*\n' into a list of strings per board
    :param file_path: path to PBN file
    :return:
    """
    with open(file_path, "r") as pbn_file:
        records = []
        current_record = ""
        while True:
            line = pbn_file.readline()
            if line == "":  # EOF
                return records
            elif line == "\n":  # End of Board Record
                records.append(current_record.splitlines())
                current_record = ""
            else:
                current_record += line