gender or pronoun tag

merge-requests/21/head
Bob Mottram 2021-03-03 14:30:50 +00:00
parent ce75a26a3c
commit dd3d4d27fc
16 changed files with 41 additions and 19 deletions

View File

@ -386,5 +386,6 @@
"He/Him": "هو",
"She/Her": "هي",
"girl": "فتاة",
"boy": "صبي"
"boy": "صبي",
"pronoun": "ضمير"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Ell",
"She/Her": "Ella",
"girl": "noia",
"boy": "noi"
"boy": "noi",
"pronoun": "pronom"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Ef",
"She/Her": "Hi/Ei",
"girl": "merch",
"boy": "bachgen"
"boy": "bachgen",
"pronoun": "rhagenw"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Er/ihm",
"She/Her": "Sie",
"girl": "mädchen",
"boy": "junge"
"boy": "junge",
"pronoun": "pronomen"
}

View File

@ -386,5 +386,6 @@
"He/Him": "He/Him",
"She/Her": "She/Her",
"girl": "girl",
"boy": "boy"
"boy": "boy",
"pronoun": "pronoun"
}

View File

@ -386,5 +386,6 @@
"He/Him": "El",
"She/Her": "Ella",
"girl": "muchacha",
"boy": "niño"
"boy": "niño",
"pronoun": "pronombre"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Il/Lui",
"She/Her": "Elle",
"girl": "fille",
"boy": "garçon"
"boy": "garçon",
"pronoun": "pronom"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Sé/Eisean",
"She/Her": "Sí",
"girl": "cailín",
"boy": "buachaill"
"boy": "buachaill",
"pronoun": "forainm"
}

View File

@ -386,5 +386,6 @@
"He/Him": "वह/उसे",
"She/Her": "वह/उसकी",
"girl": "लड़की",
"boy": "लड़का"
"boy": "लड़का",
"pronoun": "सवर्नाम"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Lui",
"She/Her": "Lei",
"girl": "ragazza",
"boy": "ragazzo"
"boy": "ragazzo",
"pronoun": "pronome"
}

View File

@ -386,5 +386,6 @@
"He/Him": "彼",
"She/Her": "彼女",
"girl": "女の子",
"boy": "男の子"
"boy": "男の子",
"pronoun": "代名詞"
}

View File

@ -382,5 +382,6 @@
"He/Him": "He/Him",
"She/Her": "She/Her",
"girl": "girl",
"boy": "boy"
"boy": "boy",
"pronoun": "pronoun"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Ele",
"She/Her": "Ela",
"girl": "garota",
"boy": "garoto"
"boy": "garoto",
"pronoun": "pronome"
}

View File

@ -386,5 +386,6 @@
"He/Him": "Он/Его",
"She/Her": "Она/Ее",
"girl": "девочка",
"boy": "мальчик"
"boy": "мальчик",
"pronoun": "местоимение"
}

View File

@ -386,5 +386,6 @@
"He/Him": "他",
"She/Her": "她",
"girl": "女孩",
"boy": "男生"
"boy": "男生",
"pronoun": "代词"
}

View File

@ -678,6 +678,7 @@ def getGenderFromBio(baseDir: str, actor: str, personCache: {},
if not personCache.get(actor):
return None
bioFound = None
pronounStr = translate['pronoun'].lower()
if personCache[actor].get('actor'):
# is gender defined as a profile tag?
if personCache[actor]['actor'].get('attachment'):
@ -692,6 +693,9 @@ def getGenderFromBio(baseDir: str, actor: str, personCache: {},
translate['gender'].lower():
bioFound = tag['value']
break
elif tag['name'].lower().startswith(pronounStr):
bioFound = tag['value']
break
# if not then use the bio
if not bioFound and personCache[actor]['actor'].get('summary'):
bioFound = personCache[actor]['actor']['summary']
@ -715,6 +719,9 @@ def getGenderFromBio(baseDir: str, actor: str, personCache: {},
translate['gender'].lower():
bioFound = tag['value']
break
elif tag['name'].lower().startswith(pronounStr):
bioFound = tag['value']
break
# if not then use the bio
if not bioFound and actorJson.get('summary'):
bioFound = actorJson['summary']
@ -723,11 +730,11 @@ def getGenderFromBio(baseDir: str, actor: str, personCache: {},
gender = 'They/Them'
bioFoundOrig = bioFound
bioFound = bioFound.lower()
if translate['He/Him'] in bioFound or \
translate['boy'] in bioFound:
if translate['He/Him'].lower() in bioFound or \
translate['boy'].lower() in bioFound:
gender = 'He/Him'
elif (translate['She/Her'] in bioFound or
translate['girl'] in bioFound):
elif (translate['She/Her'].lower() in bioFound or
translate['girl'].lower() in bioFound):
gender = 'She/Her'
elif 'him' in bioFound or 'male' in bioFound:
gender = 'He/Him'