This is an entry for NaNoGenMo 2022. It takes two or more texts and forms a "novel" of words taken alternately from each input, with a number of "sentences" equal to those in the text with the least number of sentences. Each "sentence" in the output has a number of words equal to the sentence with the least number of words at the given position in all inputs.
Install Poetry, clone this repository, then run
cd cross-product
poetry install
poetry run cross <text1> <text2> <etc> > output.txt
By default, the program will look for input files in the pg_cache/
directory. You can also supply Project Gutenberg text numbers; the
metadata files and text files will be cached in the same location.
A sample is included in this repo, produced by operating on Moby Dick, The History of Tom Jones, a Foundling, and Middlemarch, each obtained from Project Gutenberg:
poetry run cross 2701-0.txt 6593-0.txt pg145.txt > moby-jones-march.txt
Another sample output was produced by squashing War and Peace, Crime and Punishment, and Anna Karenina:
poetry run cross 2600 2554 1399 > war-crime-karenina.txt