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

*team parsing much improved. Copes with everything now.

This commit is contained in:
Philip Sargent
2022-10-10 15:40:21 +03:00
parent 52a035e4cf
commit ff8eaa241e
2 changed files with 41 additions and 4 deletions

View File

@@ -133,15 +133,32 @@ def who_is_this(year,possibleid):
return personexpedition.person
else:
return None
def known_foreigner(id):
'''If this someone from ARGE or a known Austrian? Name has to be exact, no soft matching
'''
friends = ["P. Jeutter", "K. Jäger", "S. Steinberger", "R. Seebacher",
"Dominik Jauch", "Fritz Mammel", "Marcus Scheuerman",
"Uli Schütz", "Wieland Scheuerle",
"Kai Schwekend", "Regina Kaiser", "Thilo Müller","Wieland Scheuerle",
"Florian Gruner", "Helmut Stopka-Ebeler", "Aiko", "Mark Morgan"]
if id in friends:
return True
else:
return False
# Refactor. The dict GetPersonExpeditionNameLookup(expo) indexes by name and has values of personexpedition
# This is convoluted, the whole personexpedition concept is unnecessary.
# This is convoluted, the whole personexpedition concept is unnecessary?
Gpersonexpeditionnamelookup = { }
def GetPersonExpeditionNameLookup(expedition):
global Gpersonexpeditionnamelookup
def apply_variations(f, l):
'''Be generous in guessing possible matches. Any duplicates will be ruled as invalid.
'''
f = f.lower()
l = l.lower()
variations = []
@@ -151,8 +168,9 @@ def GetPersonExpeditionNameLookup(expedition):
variations.append(f + " " + l)
variations.append(f + " " + l[0])
variations.append(f + l[0])
variations.append(f + l[0] + '.')
variations.append(f + " " +l[0] + '.')
variations.append(f[0] + " " + l)
variations.append(f[0] + ". " + l)
variations.append(f[0] + l)
variations.append(f[0] + l[0]) # initials e.g. gb or bl
return variations
@@ -188,25 +206,36 @@ def GetPersonExpeditionNameLookup(expedition):
if f == "Robert".lower():
possnames += apply_variations("Bob", l)
if f == "Rob".lower():
possnames += apply_variations("Robert", l)
if f == "Andrew".lower():
possnames += apply_variations("Andy", l)
if f == "Andy".lower():
possnames += apply_variations("Andrew", l)
if f == "Michael".lower():
possnames += apply_variations("Mike", l)
if f == "David".lower():
possnames += apply_variations("Dave", l)
if f == "Dave".lower():
possnames += apply_variations("David", l)
if f == "Peter".lower():
possnames += apply_variations("Pete", l)
if f == "Pete".lower():
possnames += apply_variations("Peter", l)
if f == "Olly".lower():
possnames += apply_variations("Oliver", l)
if f == "Oliver".lower():
possnames += apply_variations("Olly", l)
if f == "Ollie".lower():
possnames += apply_variations("Oliver", l)
if f == "Oliver".lower():
possnames += apply_variations("Ollie", l)
if f == "Becka".lower():
possnames += apply_variations("Rebecca", l)