diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-04-20 12:05:05 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-04-20 12:05:05 +0100 |
commit | af414396d682452303a01d0df70f7a7512c26e32 (patch) | |
tree | a342a71ad59299a80982200b5a45d833818944ba /parsers/people.py | |
parent | dfdf21459a08664956cd7c05d8d0f69ae4ff872b (diff) | |
download | troggle-af414396d682452303a01d0df70f7a7512c26e32.tar.gz troggle-af414396d682452303a01d0df70f7a7512c26e32.tar.bz2 troggle-af414396d682452303a01d0df70f7a7512c26e32.zip |
matching fix for db import to match folklist parser
Diffstat (limited to 'parsers/people.py')
-rw-r--r-- | parsers/people.py | 10 |
1 files changed, 9 insertions, 1 deletions
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 <span-lang = "hu"> - + 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 |