diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-10-10 15:40:21 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-10-10 15:40:21 +0300 |
commit | ff8eaa241e8f23e6c207568c76ce618c358a93eb (patch) | |
tree | 32da4120fc320a7096a46b403909f1343d1c62eb /parsers/people.py | |
parent | 52a035e4cf53d16f1b0dc60d7232fb403208ce63 (diff) | |
download | troggle-ff8eaa241e8f23e6c207568c76ce618c358a93eb.tar.gz troggle-ff8eaa241e8f23e6c207568c76ce618c358a93eb.tar.bz2 troggle-ff8eaa241e8f23e6c207568c76ce618c358a93eb.zip |
*team parsing much improved. Copes with everything now.
Diffstat (limited to 'parsers/people.py')
-rw-r--r-- | parsers/people.py | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/parsers/people.py b/parsers/people.py index 6a4456b..0f3a66e 100644 --- a/parsers/people.py +++ b/parsers/people.py @@ -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) |