NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Cassandra: Generated novel using Sed and bash scripting #47

Open hornc opened 4 years ago

hornc commented 4 years ago

The plan here is to use fairly basic repeated string substitutions to form a "novel", using public domain texts as inputs, and command line bash tools to organise the source material in various ways.

Starting point: Jane Austen's 'THE BEAUTIFULL CASSANDRA' https://www.pemberley.com/janeinfo/juviscrp.html#beaucassand

Obviously it needs expanding to meet the 50K word limit, but it will provide the basic 'plot' structure. Each of the 12 chapters needs to be expanded to ~4167 words.

I might use online search APIs to give a bit of random topic expansion, or the source material may be pre-chosen. Unsure if I want a completely deterministic result, or one that changes at each run.

Currently experimenting with using 18th and 19th century scientific publications to add colour. Example: https://archive.org/details/cbarchive_53241_onthemycologyandvisceralanatom1884

Early sample of some substitutions in chapter one:

CASSANDRA` was the Daughter & the only Daughter of a celebrated olochiru in Page Street. Her father was of noble Birth, being the near relation of the Dutchess of Actinocucumi's genera.

The challenge is to see how far I can get using limited tools. If this goes according to plan, the script will be generated using multiple layers of string substitutions.

hornc commented 4 years ago

oh dear... early experiments show walls of text can be generated, with disturbing results. Each word in the source seed 'chooses' one, or maybe more, sentences from the mix-in text.

CHAPTER THE 10th

CASSANDRA was next accosted by her freind the Widow, who squeezing out her little Head thro' her less window, asked her how she did? Cassandra curtseyed & went on X, &l XX. Fig. \,\a.. 41°12' N., long. 140° 45' E.; 43 frns., sand and mud), I propose the specific name oljaponlcus. The usefull classification proposed by Professor Semper In his magnificent work has been universally adopted by systematists since the year 1868.

....

CHAPTER THE 11th

A QUARTER of a mile brought her to her paternal roof in Bond Street, from which she had now been absent nearly 7 hours. When its walls were cut thro', the anterior portion of the body- cavity was found to be filled with a large number of stout, rather short genital tubes, which branched only once or twice, but were so numerous as to obscure considerably the underlying parts.. Two Nepalese Ilornbills {Aceros nejxtlensis), purcliased April 4th, being the first examples of this fine species of Ilornbill that have been acquired by the Society. 2. A fine Gigantic Salamander of Japan {Meg aloha frachus maxi- mus), purchased April 23rd. No specimen of this Batrachian has been in the Society's collection for some time. The present exam is about 2 feet 8 inches in length.

Need to work on blending the texts. Currently the output is "sentence salad" (by design) rather than "word salad", although OCR artefacts add some of that character. Blending the texts will involve switching words out madlibs style, to mix up and hopefully form new connections between the sentences ripped from of their original context, and make the new text fit somewhat more with Austen's original theme. I may need to try a different, non-Zoological source text too.

hornc commented 4 years ago

The Cassandra source text is only 462 words long, and the mix-in London Zoological society text has 7713 words. Running my initial script produces an output of 59K words covering the 12 chapters, without my even trying to control word limits. It's probably very repetitive. I'll need to decide whether to make that a feature of the novel, or whether to use a new mix-in for each chapter.

The current ending reads like some kind of Austen-esque social commentary:

It might, indeed, well have been thought that as the Holothurian got further and further away from the parent stock which remained under the domination of the pentamerous disposition of parts, it would, as it began to develop more than five pairs of tentacles, have its sucker-feet developed in the interradial as well as the radial parts of the body. Such a theoretical consideration would find support in the fact that some forms as they grow older lose a stichopodous and acquire a sporadi- podous arrangement of the sucker-feet ; while a not unimportant consideration for the systematist is the variability of this character.. Flower, LL.D., F.R.S., President, in the Chair. The Secretary read the following report on the additions to the Society's Menagerie during the month of April 1 884 : — The total number of registered additions to the Society's Menagerie during the month of April was 220. Of these 43 were acquired by presentation, 61 by purchase, 7 were born in the Gardens, and 30 were received on deposit. The total number of departures during the same period, by death and removals, was 128.. This is the first example of this very curious bird of prey that has been acquired for the collection. Professor Bell exhibited some specimens of Estheria melitensis sent from Malta by Captain Beciier, R.A.,and stated that, in answer to his inquiries, that gentleman had confirmed the fact of the males appearing to equal in number the females, as had been stated by previous observers of the members of the genus. Lieut. -Col. II. H.. London :Academic Press, [etc.],1 833-1 965. http://www.biodiversitylibrary.org/bibliography/44963 1 884: http://www.biodiversitylibrary. Cassandra smiled & whispered to herself "This is a day well spent."

FINIS

hornc commented 4 years ago

Day 2: pulled the existing experiments into a single functioning script and committed here: https://github.com/hornc/nanogenmo2019-cassandra to provide a stable base for further improvements to the "story".

hornc commented 4 years ago

Day 2: Quickly pointed the existing code at R. W. Chambers' The King in Yellow (Cassandra || Cassilda) as a source text, and got these excerpts (edited a bit for OCR issues)

The chapter 6 section shows how "Coachman" was specifically matched and gave a coherent subject flow... which is nice to see work, given the unsophisticated nature of the tool!

CHAPTER THE 4th

SHE then proceeded to a Pastry-cook's, where she devoured six ices, refused to pay for them, knocked down the Pastry Cook & walked away. "Just back from Westchester," he said; "been doing the bucolic; milk & curds, you know, dairy-maids in sunbonnets, who say "haeow" & "I don't think" when you tell them they are pretty. I'm nearly dead for a square meal at Delmonico's. What's the news? "There is none," I replied pleasantly. "Oh, pardon, Monsieur Jack, I thought it was Monsieur West"; then blushing furiously; "oh, I see you have heard"!

...

CHAPTER THE 6th

BEING returned to the same spot of the same Street she had set out from, the Coachman demanded his Pay. A knot of people had gathered around the American Minister's carriage, which stood in front of the prison, the horses stamping & pawing in the icy street, the coachman huddled on the box, wrapped in furs.

...

CHAPTER THE 12th ...

A knock at the studio door interrupted her. "That is not fair," she murmured, "you know how how he considers me, as he considers every woman. You know how different he is from you & the rest. I have never seen a man, such a man as Monsieur Hastings." He let his cigarette go out unnoticed. Then they rose, & she took his arm with a bright nod to Mile. Cassandra smiled & whispered to herself "This is a day well spent."

FINIS

hornc commented 4 years ago

Well, I wasted a bunch of time trying to golf this to be a Nano entry, this was designed to be small from the start, but it'll need some major re-work to get under 256 bytes. I don't really want to simplify it further. Here is the output of Cassandra mixed with the King in Yellow and other short stories by Chambers: https://github.com/hornc/nanogenmo2019-cassandra/blob/master/output/Cassanda_KIY.md

greg-kennedy commented 4 years ago

Beef Soup & la Siege de Paris. Fish. Sardines a la pere Lachaise