Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alice's Adventures in Runonland #81

Open
savetz opened this issue Nov 30, 2020 · 1 comment
Open

Alice's Adventures in Runonland #81

savetz opened this issue Nov 30, 2020 · 1 comment

Comments

@savetz
Copy link

savetz commented Nov 30, 2020

"Curiouser and curiouser!" cried Alice (they was so much surprised, that
for the moment they quite forgot how to speak good English)

Alice's Adventures in Wonderland plus Through The Looking-Glass (for word count :) run through simple text replacements to:

  • replace period-space with ", and then" to make run-on sentences, making the story even more breathless than it is
  • replace gendered pronouns and other gendered words with nonbinary versions.

I could't figure out the regex commands in python to lowercase a substitution, so there's things like "...and then There was nothing else to do" rather than "and then there was nothing else to do"

Samples:

Either the well was very deep, or they fell very slowly, for they had
plenty of time as they went down to look about their and to wonder what
was going to happen next, and then First, they tried to look down and make out
what they was coming to, but it was too dark to see anything; then they
looked at the sides of the well, and noticed that they were filled with
cupboards and book-shelves; here and there they saw maps and pictures
hung upon pegs, and then They took down a jar from one of the shelves as they
passed; it was labelled "ORANGE MARMALADE", but to their great
disappointment it was empty: they did not like to drop the jar for fear
of killing somebody underneath, so managed to put it into one of the
cupboards as they fell past it.

...

"I have answered three questions, and that is enough,"
    Said their parent; "don't give yourself airs!
Do you think I can listen all day to such stuff?
    Be off, or I'll kick you down stairs!"

"That is not said right," said the Caterpillar.

"Not _quite_ right, I'm afraid," said Alice, timidly; "some of the
words have got altered."

Code:
alice-py.txt

Book:
alice-out.txt

@hugovk
Copy link
Member

hugovk commented Nov 30, 2020

Fun!


I could't figure out the regex commands in python to lowercase a substitution

You can do it with a lambda, like this:

https://stackoverflow.com/a/7588961/724176

For example:

>>> re.sub("\. +([A-Z])", lambda m: ", and then " + m.group(1).lower(), "was going to happen next. First, they tried to look down and make out")
'was going to happen next, and then first, they tried to look down and make out'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants