def to_disk(
        self, path: Union[str, Path], filename: str = "lookups.bin", **kwargs
    ) -> None:
        """Save the lookups to a directory as lookups.bin. Expects a path to a
        directory, which will be created if it doesn't exist.

        path (str / Path): The file path.

        DOCS: https://spacy.io/api/lookups#to_disk
        """
        path = ensure_path(path)
        if not path.exists():
            path.mkdir()
        filepath = path / filename
        with filepath.open("wb") as file_:
            file_.write(self.to_bytes())
Save the lookups to a directory as lookups.bin. Expects a path to a
        directory, which will be created if it doesn't exist.

        path (str / Path): The file path.

        DOCS: https://spacy.io/api/lookups#to_disk
        
spacy/lookups.py