git @ Cat's Eye Technologies Chainscape / master doc / Instructions-for-Generating.md
master

Tree @master (Download .tar.gz)

Instructions-for-Generating.md @masterview markup · raw · history · blame

Instructions for Generating "The Other and the Same"

Use bash or a similar shell on Ubuntu 20.04 or a similar system.

git clone https://codeberg.org/catseye/T-Rext
cd T-Rext
git fetch origin
git checkout 0.4
cd ..

git clone https://codeberg.org/catseye/Chainscape
cd Chainscape
virtualenv --python=python3.9 venv
source venv/bin/activate
python3 --version   # Python 3.9.16
pip install -r requirements.txt
mkdir corpus
for N in 11 16 45 55 98 345 768 2701 5921 64317; do
    wget "https://gutenberg.org/cache/epub/$N/pg$N-images.html" -O "corpus/$N.html"
    python3 src/extract-tokenstream.py "corpus/$N.html" > "corpus/$N.txt"
    sleep 10
done

echo "The Other and the Same" >novel.md
echo "======================" >>novel.md
python3 src/transition-matrix.py intersect corpus/*.txt --seed 50000 --count 69972 | ../T-Rext/bin/t-rext - >>novel.md
wc -w novel.md   # 50250 novel.md
export HTML="The Other and the Same.html"
echo '<!DOCTYPE html>' >"$HTML"
echo '<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>' >>"$HTML"
markdown_py -o html < novel.md >>"$HTML"