Beispiel #1
0
def get_text_paths():
    with open(json_path, "r") as f:
        texts = json.load(f)
        for text in texts:
            author = text["Author"]
            title = text["Title"]
            period = text["Period"]
            url = text["URL"]
            filename = format_filename(author, title)
            yield filename, period
Beispiel #2
0
def distributions():
    for period, texts in TEXTS_DISTRIBUTIONS.items():
        for i, distribution in enumerate(texts):
            title = "%s%d" % (period, i + 1)
            filename  = format_filename(author="test", title=title)
            yield filename, distribution
Beispiel #3
0
def test_sources():
    for author, title, period, url in trainer.json():
        yield _test_exists, format_filename(author, title)