From af414396d682452303a01d0df70f7a7512c26e32 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 20 Apr 2024 12:05:05 +0100 Subject: matching fix for db import to match folklist parser --- parsers/people.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'parsers/people.py') diff --git a/parsers/people.py b/parsers/people.py index dd4d896..2d7c5b0 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -75,7 +75,8 @@ def troggle_slugify(longname): slug = slug.replace('&', '') # otherwise just remove the & slug = slug.replace(';', '') # otherwise just remove the ; slug = re.sub(r'<[^>]*>','',slug) # remove - + slug=slug.strip("-") # remove spare hyphens + if len(slug) > 40: # slugfield is 50 chars slug = slug[:40] if slug in slug_cache: @@ -237,6 +238,13 @@ Gpersonexpeditionnamelookup = {} def GetPersonExpeditionNameLookup(expedition): """Yes this should all be in an editable text file, not in the body of the code. Sorry. + + This uses the existing database records of everone on an expedition to construct a dictionary + indexedby every possible pseudonym or alias that the person might be known by. + + This dictionary is used when parsing logbooks and survex files to identify who is being + referred to, when the name written in the logbook is e.g. "Mike TA" == "Mike The Animal" + == "Mike Rickardson". """ global Gpersonexpeditionnamelookup -- cgit v1.2.3