-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetLines.py
47 lines (37 loc) · 1.18 KB
/
getLines.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
VALID_LEVEL = ["max", "min", "mix"]
VALID_TARGET = ["female", "male", "mix"]
def getLines(config):
linesFemale = []
linesMale = []
if config['level'] == "max" or config['level'] == "mix":
with open("resources-max.txt", "r", encoding="utf-8") as resources:
linesFemale += resources.readlines()
if config['level'] == "min" or config['level'] == "mix":
with open("resources-min.txt", "r", encoding="utf-8") as resources:
linesFemale += resources.readlines()
if config['target'] == "female":
return linesFemale
else:
linesMale = [replaceF2M(s) for s in linesFemale]
if config['target'] == "male":
return linesMale
else:
return linesFemale + linesMale
replaceTable = [
['妈', '爸'],
['🐴', '👴'],
['🐎', '👴'],
["母亲", "父亲"],
["母", "公"],
["你吗", "你爹"],
["逼", "屌"],
["阴道", "肛门"],
["处女", "处男"],
["娘", "爹"],
["她", "他"],
]
def replaceF2M(s):
r = s
for replace in replaceTable:
r = r.replace(*replace)
return r