翻转文本片段或epub中的性别
gender-bender的Python项目详细描述
性变态
此库允许您翻转字符串或电子书的性别(仅适用于epub
格式)。其动机是能够以一种有趣的方式审视性别规范。在
要使用epub
格式,我建议使用Calibre阅读器或Kobo。在
安装
Python 3仅限
使用pip
:
pip install gender-bender
或使用poetry
:
Note:第一次使用时,它将为Spacy依赖关系安装一个英语模型。这个 由于this issue,无法从PyPI安装。在
用法
或者来自python:
fromgender_benderimportgender_bend_epubgender_bend_epub('./Mythical_Man_Month.epub')
也可以按性别弯曲字符串:
fromgender_benderimportgender_bendx=gender_bend("If Ivanka weren't my daughter, perhaps I'd be dating her.")assertx=="If Ivan weren't my son, perhaps I'd be dating him."
从源安装
获取回购:
git clone https://github.com/Garrett-R/gender_bender.git
cd gender_bender
pip install -r requirements.txt
它可以作为脚本运行:
./main.py --input Lord_of_the_Flies.epub --output Lady_of_the_Flies.epub
如果你想自己选择名字(推荐翻译整本电子书),你可以:
./main.py --input The_Little_Mermaid.epub --interactive-naming
- 项目
标签: