Source code for word_text_counter.datasets

from importlib import resources

[docs]def get_flatland_path() -> str: """get sample text file path, with name "flatland.txt". Returns: str: a flatland.txt path. """ with resources.path("word_text_counter.data","flatland.txt") as fp: file_path = fp return str(file_path)
[docs]def get_time_machine_path() -> str: """get sample text file path, with name "time_machine.txt". Returns: str: a time_machine.txt path. """ with resources.path("word_text_counter.data","time_machine.txt") as fp: file_path = fp return str(file_path)
[docs]def get_lostworld_path() -> str: """get sample text file path, with name "lostworld.txt". Returns: str: a lostworld.txt path. """ with resources.path("word_text_counter.data","lostworld.txt") as fp: file_path = fp return str(file_path)