def METHOD_NAME(document_store, dir):
    # Importing top-level causes a circular import
    from haystack.nodes import TextConverter, PreProcessor
    if dir == "data/GoT_getting_started":
        # Download and add Game of Thrones TXT files
        fetch_archive_from_http(
            url="https://s3.eu-central-1.amazonaws.com/deepset.ai-farm-qa/datasets/documents/wiki_gameofthrones_txt.zip",
            output_dir=dir,
        )
        files_to_index = [dir + "/" + f for f in os.listdir(dir)]
        converter = TextConverter(remove_numeric_tables=True, valid_languages=["en"])
        docs = [converter.convert(file_path=file, meta=None)[0] for file in files_to_index]
    else:
        # Here you can add a local folder with your files(.txt, .pdf, .docx).
        # You might need to install additional packages with "pip install farm-haystack[ocr,preprocessing,file-conversion,pdf]".
        # For more details, see: https://haystack.deepset.ai/tutorials/08_preprocessing.
        # Be aware that some of your data will be sent to external APIs if you use this functionality!
        files_to_index = [dir + "/" + f for f in os.listdir(dir)]
        logger.info("Adding %s number of files from local disk at %s.", len(files_to_index), dir)
        docs = convert_files_to_docs(dir_path=dir)
    preprocessor = PreProcessor(
        split_by="word", split_length=200, split_overlap=0, split_respect_sentence_boundary=True
    )
    docs_processed = preprocessor.process(docs)
    document_store.write_documents(documents=docs_processed)