-
Notifications
You must be signed in to change notification settings - Fork 21
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
Comments
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:
The repo is here, the text is 104,880 words long. If you have any questions or suggestions for improvement, let me know! |
Good stuff! Little formatting suggestion: perhaps something like |
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
But that may actually be overkill, since you seem to have split all the sentences correctly already. |
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:
And here's how the book reads from an entirely male point of view in He: The Adventures of Sherlock Holmes:
|
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. |
@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:
|
My NaNoGenMo project performs a character swap on any novel, provided a list of new characters and gender pronouns.
The text was updated successfully, but these errors were encountered: