2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 07:47:13 +00:00

small chnages to name resolution

This commit is contained in:
Philip Sargent
2022-10-07 23:47:05 +03:00
parent c76cd38d76
commit f51d1e114e
3 changed files with 11 additions and 3 deletions

View File

@@ -129,6 +129,11 @@ def load_people_expos():
# used in other referencing parser functions
# expedition name lookup cached for speed (it's a very big list)
# should have a LIST of nicknames, just populate the first entry from folk.csv
# Refactor. The dict GetPersonExpeditionNameLookup(expo) indexes by name and has values of personexpedition
# This is convoluted, the whole personexpedition concept is unnecessary.
Gpersonexpeditionnamelookup = { }
def GetPersonExpeditionNameLookup(expedition):
global Gpersonexpeditionnamelookup
@@ -151,14 +156,15 @@ def GetPersonExpeditionNameLookup(expedition):
possnames.append(f + " " + l[0])
possnames.append(f + l[0])
possnames.append(f[0] + " " + l)
possnames.append(f[0] + l[0]) # initials e.g. gb or bl
possnames.append(f)
if full not in possnames:
possnames.append(full)
if personexpedition.nickname not in possnames:
possnames.append(personexpedition.nickname.lower())
if l:
# This allows for nickname to be used for short name eg Phil
# adding Phil Sargent to the list
# This allows for nickname to be used for short name
# eg Phil S is adding Phil Sargent to the list
if str(personexpedition.nickname.lower() + " " + l) not in possnames:
possnames.append(personexpedition.nickname.lower() + " " + l)
if str(personexpedition.nickname.lower() + " " + l[0]) not in possnames: