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

Character Swap and The Adventures of Charlotte Holmes #82

Open
emdaniels opened this issue Nov 1, 2015 · 7 comments
Open

Character Swap and The Adventures of Charlotte Holmes #82

emdaniels opened this issue Nov 1, 2015 · 7 comments

Comments

@emdaniels
Copy link

My NaNoGenMo project performs a character swap on any novel, provided a list of new characters and gender pronouns.

@emdaniels emdaniels changed the title intense intent in tents intense intents in tents Nov 1, 2015
@emdaniels
Copy link
Author

I wrote a python script to change The Adventures of Sherlock Holmes into The Adventures of Charlotte Holmes and switch all the character genders to the opposite gender. I took creative grammatical license with a few pronouns, in the hope that future iterations would be able to change them more effectively. Here is an excerpt:

To Charlotte Holmes he is always THE man. I have seldom heard her mention him under any other name. In herr eyes he eclipses and predominates the whole of him sex. It was not that she felt any emotion akin to love for Ivan Adler. All emotions, and that one particularly, were abhorrent to herr cold, precise but admirably balanced mind. She was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover she would have placed herself in a false position. She never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer -- excellent for drawing the veil from women's motives and actions. But for the trained reasoner to admit such intrusions into herr own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all herr mental results. Grit in a sensitive instrument, or a crack in one of herr own high-power lenses, would not be more disturbing than a strong emotion in a nature such as herr. And yet there was but one man to her, and that man was the late Ivan Adler, of dubious and questionable memory.

The repo is here, the text is 104,880 words long. If you have any questions or suggestions for improvement, let me know!

@hugovk
Copy link
Collaborator

hugovk commented Nov 15, 2015

Good stuff!

Little formatting suggestion: perhaps something like textwrap would be useful to wrap the lines to something like 70-80 characters, like the PG input, rather having one sentence per line.

@ikarth
Copy link

ikarth commented Nov 15, 2015

Surprisingly effective result from a small swerve.

Looks like the one-per-line thing is because it's not tracking the paragraphs. That'd be a good next step I think. Plus the quotation marks at the end of paragraphs are getting missed, and occasionally some other ones.

An alternate way to do it is how #72 does it: rather than writing the new file from scratch, it takes the original text file and constructs a regex that replaces the words it wants to swap. Downside: you have to algorithmically construct a complex regex. Though I suppose, since you're processing the text bit-by-bit anyway, you could re-write write it so it just goes line-by-line and doesn't care about sentences.

You could also grab nltk and use it to parse the sentences out with

import nltk.data
sent_detector = nltk.data.load('tokenizers/punkt/english.pickle')
sentences = sent_detector.tokenize(text)

But that may actually be overkill, since you seem to have split all the sentences correctly already.

@emdaniels
Copy link
Author

Thanks for your feedback! It does seem that eventually to get to a place where gender choice happens on the fictional character level I'll need to use a tokenizer, but it's not there yet. In the interim, I added an 80 character line limit and support for creating additional texts that are all female or all male. Here's how the book reads from an entirely female point of view in She: The Adventures of Charlotte Holmes:

To Charlotte Holmes she is always THE woman. I have seldom heard her mention her under any other name. In herr eyes she eclipses and predominates the whole of her sex. It was not that she felt any emotion akin to love for Irene Adler. All emotions, and that one particularly, were abhorrent to herr cold, precise but admirably balanced mind. She was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover she would have placed herself in a false position. She never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer -- excellent for drawing the veil from women's motives and actions. But for the trained reasoner to admit such intrusions into herr own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all herr mental results. Grit in a sensitive instrument, or a crack in one of herr own high-power lenses, would not be more disturbing than a strong emotion in a nature such as herr. And yet there was but one woman to her, and that woman was the late Irene Adler, of dubious and questionable memory.

And here's how the book reads from an entirely male point of view in He: The Adventures of Sherlock Holmes:

To Sherlock Holmes he is always THE man. I have seldom heard him mention his under any other name. In his eyes he eclipses and predominates the whole of his sex. It was not that he felt any emotion akin to love for Ivan Adler. All emotions, and that one particularly, were abhorrent to his cold, precise but admirably balanced mind. He was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover he would have placed himself in a false position. He never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer -- excellent for drawing the veil from men's motives and actions. But for the trained reasoner to admit such intrusions into his own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all his mental results. Grit in a sensitive instrument, or a crack in one of his own high-power lenses, would not be more disturbing than a strong emotion in a nature such as his. And yet there was but one man to him, and that man was the late Ivan Adler, of dubious and questionable memory.

@greg-kennedy
Copy link

What's with "herr" instead of "her"?

@ikarth
Copy link

ikarth commented Nov 19, 2015

What's with "herr" instead of "her"?

I assume it's because of things like "his" being ambiguous between his->her and his->hers. Thus the "creative grammatical license".

It also, possibly accidentally, situates it in the tradition of asserting a non-binary gender identification with a pronoun that avoids or corrects a deficiency in English (which not only bundles a lot of cultural assumptions in its pronoun use, but also wore away much of its more interesting pronoun structures over the last dozen centuries or so.) Which, to my mind, is entirely appropriate for a text that is examining the gender assumptions of well-known novels.

@emdaniels
Copy link
Author

@ikarth is correct- thank you! I've just added support for a they/them/their version of the story, as well as fixed a bug that was messing up some of the punctuation. An excerpt from They: The Adventures of Hemlock Holmes:

To Hemlock Holmes they is always THE person. I have seldom heard them mention them under any other name. In their eyes they eclipses and predominates the whole of them sex. It was not that they felt any emotion akin to love for Eren Adler. All emotions, and that one particularly, were abhorrent to their cold, precise but admirably balanced mind. They was, I take it, the most perfect reasoning and observing machine that the world has seen, but as a lover they would have placed themself in a false position. They never spoke of the softer passions, save with a gibe and a sneer. They were admirable things for the observer -- excellent for drawing the veil from people's motives and actions. But for the trained reasoner to admit such intrusions into their own delicate and finely adjusted temperament was to introduce a distracting factor which might throw a doubt upon all their mental results. Grit in a sensitive instrument, or a crack in one of their own high-power lenses, would not be more disturbing than a strong emotion in a nature such as their. And yet there was but one person to them, and that person was the late Eren Adler, of dubious and questionable memory.

@emdaniels emdaniels changed the title intense intents in tents Character Swap and the creation of The Adventures of Charlotte Holmes Dec 2, 2015
@emdaniels emdaniels changed the title Character Swap and the creation of The Adventures of Charlotte Holmes Character Swap and The Adventures of Charlotte Holmes Dec 2, 2015
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

4 participants